[Xfce4-commits] [panel-plugins/xfce4-clipman-plugin] 28/28: Drop unused grab code and fix panel-button pressed state

noreply at xfce.org noreply at xfce.org
Thu May 19 20:06:30 CEST 2016


This is an automated email from the git hooks/post-receive script.

ochosi pushed a commit to branch master
in repository panel-plugins/xfce4-clipman-plugin.

commit 4538acda3e6d06cccc84ea4ecc2eeed89e8fdc40
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Wed May 18 23:46:24 2016 +0200

    Drop unused grab code and fix panel-button pressed state
---
 panel-plugin/main-panel-plugin.c |  1 -
 panel-plugin/plugin.c            | 20 ++------------------
 2 files changed, 2 insertions(+), 19 deletions(-)

diff --git a/panel-plugin/main-panel-plugin.c b/panel-plugin/main-panel-plugin.c
index e180016..c6b28ab 100644
--- a/panel-plugin/main-panel-plugin.c
+++ b/panel-plugin/main-panel-plugin.c
@@ -133,7 +133,6 @@ cb_button_pressed (GtkButton *button,
 {
   if (event->button != 1 && !(event->state & GDK_CONTROL_MASK))
     return FALSE;
-
   if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
     plugin_popup_menu (plugin);
 
diff --git a/panel-plugin/plugin.c b/panel-plugin/plugin.c
index 05ae5a0..0e1ba4d 100644
--- a/panel-plugin/plugin.c
+++ b/panel-plugin/plugin.c
@@ -356,11 +356,8 @@ plugin_popup_menu (MyPlugin *plugin)
   gtk_menu_popup (GTK_MENU (plugin->menu), NULL, NULL,
                   plugin->menu_position_func, plugin,
                   0, gtk_get_current_event_time ());
-  if (gtk_grab_get_current () == plugin->menu)
-    {
-      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (plugin->button), TRUE);
-      xfce_panel_plugin_register_menu (plugin->panel_plugin, GTK_MENU (plugin->menu));
-    }
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (plugin->button), TRUE);
+  xfce_panel_plugin_register_menu (plugin->panel_plugin, GTK_MENU (plugin->menu));
 #elif defined (STATUS_ICON)
 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   gtk_menu_set_screen (GTK_MENU (plugin->menu), gtk_status_icon_get_screen (plugin->status_icon));
@@ -484,38 +481,25 @@ xfce_popup_grab_available (GdkWindow *win, guint32 timestamp)
     GdkDeviceManager *device_manager = gdk_display_get_device_manager(display);
     GdkDevice* device = gdk_device_manager_get_client_pointer(device_manager);
     GdkGrabStatus g;
-    //GdkGrabStatus g2;
     gboolean grab_failed = FALSE;
     gint i = 0;
 
     TRACE ("entering grab_available");
 
     g = gdk_device_grab (device, win, GDK_OWNERSHIP_WINDOW, TRUE, mask, NULL, timestamp);
-    //g1 = gdk_pointer_grab (win, TRUE, mask, NULL, NULL, timestamp);
-    //g2 = gdk_keyboard_grab (win, TRUE, timestamp);
 
     while ((i++ < 2500) && (grab_failed = (g != GDK_GRAB_SUCCESS)))
     {
         TRACE ("grab not available yet, waiting... (%i)", i);
         g_usleep (100);
         if (g != GDK_GRAB_SUCCESS)
-        {
             g = gdk_device_grab (device, win, GDK_OWNERSHIP_WINDOW, TRUE, mask, NULL, timestamp);
-        }
-//        if (g2 != GDK_GRAB_SUCCESS)
-//        {
-//            g2 = gdk_keyboard_grab (win, TRUE, timestamp);
-//        }
     }
 
     if (g == GDK_GRAB_SUCCESS)
     {
         gdk_device_ungrab (device, timestamp);
     }
-//    if (g2 == GDK_GRAB_SUCCESS)
-//    {
-//        gdk_keyboard_ungrab (timestamp);
-//    }
 
     return (!grab_failed);
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list