aboutsummaryrefslogtreecommitdiffstats
path: root/src/camorama-window.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-09-06 06:58:58 -0300
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-09-07 11:36:56 -0300
commit74b2dab8b286c1e4bda3b264036e79c4e11d8774 (patch)
tree24cd7d23fa7f053452f6551b15c1ccb33e38d963 /src/camorama-window.c
parenta9cf1845c57c60239a3ccd150812ba7eff5fda4f (diff)
add the compatibility bits needed to build it with gtk 4
Now that we don't use gtk_init_*() anymore, there are just a few minor changes required at the source code in order to make it build with Gtk 4. Please notice that there's a small hack there: originally, the popup menu required mouse button 3. I was unable to discover how to get it with gtk 4. As the other buttons are unused, with the new code, any mouse button will open the popup effects window. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'src/camorama-window.c')
-rw-r--r--src/camorama-window.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/camorama-window.c b/src/camorama-window.c
index 0bb830e..0abf162 100644
--- a/src/camorama-window.c
+++ b/src/camorama-window.c
@@ -143,7 +143,11 @@ static void show_popup(cam_t *cam, GtkTreeView *treeview,
}
g_free(filters);
+#if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 90
+ gtk_widget_show(GTK_WIDGET(menu));
+#else
gtk_widget_show_all(GTK_WIDGET(menu));
+#endif
#if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 22
gtk_menu_popup_at_pointer(menu, NULL);
#else
@@ -160,6 +164,19 @@ static void treeview_popup_menu_cb(cam_t *cam, GtkTreeView *treeview)
show_popup(cam, treeview, NULL);
}
+#if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 90
+static gboolean treeview_clicked_cb(cam_t *cam, GtkButton *button)
+{
+ GtkTreeView *treeview;
+
+ treeview = GTK_TREE_VIEW(gtk_builder_get_object(cam->xml,
+ "treeview_effects"));
+
+ // FIXME: how to check if pressed button was button 3?
+ show_popup(cam, treeview, NULL);
+ return TRUE;
+}
+#else
static gboolean treeview_clicked_cb(cam_t *cam, GdkEventButton *ev,
GtkTreeView *treeview)
{
@@ -172,6 +189,7 @@ static gboolean treeview_clicked_cb(cam_t *cam, GdkEventButton *ev,
return retval;
}
+#endif
void load_interface(cam_t *cam)
{

Privacy Policy