aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-09-05 16:29:54 -0300
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-09-05 16:53:12 -0300
commit8f1c0e19e683ab937a66bda86307cd5d9d265f18 (patch)
treed65823b9e42feeb3804c02fbb308200f133e9f47 /src
parentb99c1249ef357bda32b2bbc0aab773fb32c51eab (diff)
camorama-window: fix tray icon
The tray icon logic is currently broken. Fix it. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'src')
-rw-r--r--src/camorama-stock-items.c15
-rw-r--r--src/camorama-window.c19
2 files changed, 12 insertions, 22 deletions
diff --git a/src/camorama-stock-items.c b/src/camorama-stock-items.c
index f9ea37b..b88674c 100644
--- a/src/camorama-stock-items.c
+++ b/src/camorama-stock-items.c
@@ -43,23 +43,8 @@ void camorama_stock_init(void)
gtk_icon_factory_add(factory, CAMORAMA_STOCK_WEBCAM, set);
- add_default_image(CAMORAMA_STOCK_WEBCAM, 16, PACKAGE_DATA_DIR
- "/icons/hicolor/16x16/devices/camorama.png");
add_default_image(CAMORAMA_STOCK_WEBCAM, 24, PACKAGE_DATA_DIR
"/icons/hicolor/24x24/devices/camorama.png");
- add_default_image(CAMORAMA_STOCK_WEBCAM, 32, PACKAGE_DATA_DIR
- "/icons/hicolor/32x32/devices/camorama.png");
- add_default_image(CAMORAMA_STOCK_WEBCAM, 48, PACKAGE_DATA_DIR
- "/icons/hicolor/48x48/devices/camorama.png");
- add_default_image(CAMORAMA_STOCK_WEBCAM, 64, PACKAGE_DATA_DIR
- "/icons/hicolor/64x64/devices/camorama.png");
- add_default_image(CAMORAMA_STOCK_WEBCAM, 128, PACKAGE_DATA_DIR
- "/icons/hicolor/128x128/devices/camorama.png");
- add_default_image(CAMORAMA_STOCK_WEBCAM, 256, PACKAGE_DATA_DIR
- "/icons/hicolor/256x256/devices/camorama.png");
- add_default_image(CAMORAMA_STOCK_WEBCAM, 512, PACKAGE_DATA_DIR
- "/icons/hicolor/512x512/devices/camorama.png");
-
gtk_icon_factory_add_default(factory);
gtk_icon_set_unref(set);
diff --git a/src/camorama-window.c b/src/camorama-window.c
index ff1333c..70da11a 100644
--- a/src/camorama-window.c
+++ b/src/camorama-window.c
@@ -168,11 +168,11 @@ static gboolean treeview_clicked_cb(cam_t *cam, GdkEventButton *ev,
return retval;
}
-static void tray_clicked_callback(GtkStatusIcon *status, guint button,
- guint activate_time, cam_t *cam)
+static gboolean tray_clicked_callback(GtkStatusIcon *icon, GdkEventButton *ev,
+ cam_t *cam)
{
- // FIXME: change to switch
- if (button == 1) {
+ switch (ev->button) {
+ case 1:
if (gtk_widget_get_visible(GTK_WIDGET(gtk_builder_get_object(cam->xml, "main_window")))) {
cam->hidden = TRUE;
g_source_remove(cam->idle_id);
@@ -185,10 +185,15 @@ static void tray_clicked_callback(GtkStatusIcon *status, guint button,
(cam->xml, "main_window")));
cam->hidden = FALSE;
}
- } else if (button == 3) {
+ break;
+ case 3:
//gw = MyApp->GetMainWindow ();
//gnomemeeting_component_view (NULL, (gpointer) gw->ldap_window);
- }
+ break;
+ default:
+ break;
+ }
+ return FALSE;
}
void load_interface(cam_t *cam)
@@ -250,7 +255,7 @@ void load_interface(cam_t *cam)
g_object_set_data(G_OBJECT(cam->tray_icon), "embedded",
GINT_TO_POINTER(0));
- g_signal_connect(cam->tray_icon, "popup-menu",
+ g_signal_connect(cam->tray_icon, "button-press-event",
G_CALLBACK(tray_clicked_callback), cam);
/* connect the signals in the interface

Privacy Policy