Skip to content

Instantly share code, notes, and snippets.

@dovideh
Created November 28, 2020 06:09
Show Gist options
  • Save dovideh/c71251283a3ced0ab9e99e9517cb6b11 to your computer and use it in GitHub Desktop.
Save dovideh/c71251283a3ced0ab9e99e9517cb6b11 to your computer and use it in GitHub Desktop.
Right click behave like windows / osx - show menu on GDK_BUTTON_RELEASE
--- src.orig/xfdesktop/src/xfce-desktop.c 2020-11-28 00:28:13.965018899 +0200
+++ src/xfdesktop/src/xfce-desktop.c 2020-11-28 08:04:35.265630011 +0200
@@ -1306,7 +1306,7 @@
}
static gboolean
-xfce_desktop_button_press_event(GtkWidget *w,
+xfce_desktop_button_release_event(GtkWidget *w,
GdkEventButton *evt)
{
guint button = evt->button;
@@ -1317,7 +1317,7 @@
g_return_val_if_fail(XFCE_IS_DESKTOP(w), FALSE);
- if(evt->type == GDK_BUTTON_PRESS) {
+ if(evt->type == GDK_BUTTON_RELEASE) {
if(button == 3 || (button == 1 && (state & GDK_SHIFT_MASK))) {
#ifdef ENABLE_DESKTOP_ICONS
/* Let the icon view handle these menu pop ups */
@@ -1341,17 +1341,18 @@
return TRUE;
}
}
+ gtk_grab_remove(w);
return FALSE;
}
static gboolean
-xfce_desktop_button_release_event(GtkWidget *w,
+xfce_desktop_button_press_event(GtkWidget *w,
GdkEventButton *evt)
{
DBG("entering");
- gtk_grab_remove(w);
+// gtk_grab_remove(w);
return FALSE;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment