[gnome-applets/wip/segeiger/window-picker-in-process] Build applet in process and add some debug messages



commit b8a66e7b423890479a88017990aca3f5d97f7899
Author: Sebastian Geiger <sbastig gmx net>
Date:   Sun Jun 7 13:16:12 2015 +0200

    Build applet in process and add some debug messages

 ...g.gnome.applets.WindowPicker.panel-applet.in.in |    2 +-
 ...ome.panel.applet.WindowPickerFactory.service.in |    2 +-
 windowpicker/src/Makefile.am                       |    7 ++-
 windowpicker/src/applet.c                          |    2 +-
 windowpicker/src/task-item.c                       |   40 +++++++++++++++++++-
 5 files changed, 45 insertions(+), 8 deletions(-)
---
diff --git a/windowpicker/data/org.gnome.applets.WindowPicker.panel-applet.in.in 
b/windowpicker/data/org.gnome.applets.WindowPicker.panel-applet.in.in
index 9219bb4..d79690c 100644
--- a/windowpicker/data/org.gnome.applets.WindowPicker.panel-applet.in.in
+++ b/windowpicker/data/org.gnome.applets.WindowPicker.panel-applet.in.in
@@ -1,6 +1,6 @@
 [Applet Factory]
 Id=WindowPickerFactory
-Location= LIBEXECDIR@/window-picker-applet
+Location= LIBDIR@/window-picker-applet
 _Name=Window Picker
 _Description=Factory for the window picker applet
 
diff --git a/windowpicker/data/org.gnome.panel.applet.WindowPickerFactory.service.in 
b/windowpicker/data/org.gnome.panel.applet.WindowPickerFactory.service.in
index 0bf7f15..0a321b6 100644
--- a/windowpicker/data/org.gnome.panel.applet.WindowPickerFactory.service.in
+++ b/windowpicker/data/org.gnome.panel.applet.WindowPickerFactory.service.in
@@ -1,3 +1,3 @@
 [D-BUS Service]
 Name=org.gnome.panel.applet.WindowPickerFactory
-Exec= LIBEXECDIR@/window-picker-applet
+Exec= LIBDIR@/window-picker-applet
diff --git a/windowpicker/src/Makefile.am b/windowpicker/src/Makefile.am
index 1eee97f..f02d14f 100644
--- a/windowpicker/src/Makefile.am
+++ b/windowpicker/src/Makefile.am
@@ -1,4 +1,5 @@
-libexec_PROGRAMS=window-picker-applet
+#libexec_PROGRAMS=window-picker-applet
+lib_LTLIBRARIES=libwindowpickerapplet.la
 
 PKGDATADIR = $(datadir)/window-picker-applet
 AM_CFLAGS=\
@@ -15,11 +16,11 @@ AM_CFLAGS=\
        -DGTK_DISABLE_SINGLE_INCLUDES \
     -lm
 
-window_picker_applet_LDADD = \
+libwindowpickerapplet_la_LIBADD = \
        $(GNOME_APPLETS_LIBS) \
        $(LIBWNCK_LIBS)
 
-window_picker_applet_SOURCES = \
+libwindowpickerapplet_la_SOURCES = \
        applet.c \
        applet.h \
        task-item.c \
diff --git a/windowpicker/src/applet.c b/windowpicker/src/applet.c
index 847cfee..6b4a062 100644
--- a/windowpicker/src/applet.c
+++ b/windowpicker/src/applet.c
@@ -464,7 +464,7 @@ window_picker_applet_get_expand_task_list (WindowPickerApplet *picker) {
     return picker->priv->expand_task_list;
 }
 
-PANEL_APPLET_OUT_PROCESS_FACTORY ("WindowPickerFactory",
+PANEL_APPLET_IN_PROCESS_FACTORY ("WindowPickerFactory",
                                   WINDOW_PICKER_APPLET_TYPE,
                                   window_picker_factory,
                                   NULL);
diff --git a/windowpicker/src/task-item.c b/windowpicker/src/task-item.c
index bd7703c..4fddc4d 100644
--- a/windowpicker/src/task-item.c
+++ b/windowpicker/src/task-item.c
@@ -136,16 +136,52 @@ static gboolean on_task_item_button_released (
     if(GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget), "drag-true"))) {
         return TRUE;
     }
+    WnckWindowState state = wnck_window_get_state(window);
+    g_message("State: \
+        WNCK_WINDOW_STATE_MINIMIZED: %s\n\
+        WNCK_WINDOW_STATE_MAXIMIZED_HORIZONTALLY: %s\n\
+        WNCK_WINDOW_STATE_MAXIMIZED_VERTICALLY: %s\n\
+        WNCK_WINDOW_STATE_SHADED: %s\n\
+        WNCK_WINDOW_STATE_SKIP_PAGER: %s\n\
+        WNCK_WINDOW_STATE_SKIP_TASKLIST: %s\n\
+        WNCK_WINDOW_STATE_STICKY: %s\n\
+        WNCK_WINDOW_STATE_HIDDEN: %s\n\
+        WNCK_WINDOW_STATE_FULLSCREEN: %s\n\
+        WNCK_WINDOW_STATE_DEMANDS_ATTENTION: %s\n\
+        WNCK_WINDOW_STATE_URGENT: %s\n\
+        WNCK_WINDOW_STATE_ABOVE: %s\n\
+        WNCK_WINDOW_STATE_BELOW: %s\
+    ", 
+        (WNCK_WINDOW_STATE_MINIMIZED & state) ? ("true") : ("false"),
+        (WNCK_WINDOW_STATE_MAXIMIZED_HORIZONTALLY & state) ? ("true") : ("false"),
+        (WNCK_WINDOW_STATE_MAXIMIZED_VERTICALLY & state) ? ("true") : ("false"),
+        (WNCK_WINDOW_STATE_SHADED & state) ? ("true") : ("false"),
+        (WNCK_WINDOW_STATE_SKIP_PAGER & state) ? ("true") : ("false"),
+        (WNCK_WINDOW_STATE_SKIP_TASKLIST & state) ? ("true") : ("false"),
+        (WNCK_WINDOW_STATE_STICKY & state) ? ("true") : ("false"),
+        (WNCK_WINDOW_STATE_HIDDEN & state) ? ("true") : ("false"),
+        (WNCK_WINDOW_STATE_FULLSCREEN & state) ? ("true") : ("false"),
+        (WNCK_WINDOW_STATE_DEMANDS_ATTENTION && state) ? ("true") : ("false"),
+        (WNCK_WINDOW_STATE_URGENT & state) ? ("true") : ("false"),
+        (WNCK_WINDOW_STATE_ABOVE & state) ? ("true") : ("false"),
+        (WNCK_WINDOW_STATE_BELOW & state) ? ("true") : ("false")
+    );
+    g_message("Current GTK event time: %d", gtk_get_current_event_time ());
+    g_message("Window is active: %s", (wnck_window_is_active(window) ? "true" : "false"));
     if (event->button == 1) {
         if (WNCK_IS_WORKSPACE (workspace)
             && workspace != wnck_screen_get_active_workspace (screen))
         {
-                wnck_workspace_activate (workspace, event->time);
+            g_message("Not on active workspace");
+            wnck_workspace_activate (workspace, gtk_get_current_event_time());
         }
         if (wnck_window_is_active (window)) {
+            g_message("Minimize Window: %p\tevent->time: %d,\tcurrent_event_time: %d", window, event->time, 
gtk_get_current_event_time());
             wnck_window_minimize (window);
         } else {
-            wnck_window_activate (window, event->time);
+            g_message("Unminimize Window: %p,\tevent->time: %d,\tcurrent_event_time: %d", window, 
event->time, gtk_get_current_event_time());
+            wnck_window_activate_transient(window, gtk_get_current_event_time());
+            //wnck_window_unminimize (window, gtk_get_current_event_time());
         }
     }
     return TRUE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]