wok annotate pcmanfm/stuff/fix_desktop_menus.patch @ rev 21160

Up ufraw (0.22)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Mar 31 15:04:44 2019 +0200 (2019-03-31)
parents
children
rev   line source
psychomaniak@18756 1 Commit: http://git.lxde.org/gitweb/?p=lxde/pcmanfm.git;a=commit;h=ae7ed3af651041a5538634ac9e35dc479e280ad9
psychomaniak@18756 2 We revert it to fix desktop Openbox menus: Cannot open Right-click and Middle-Click menu in same time.
psychomaniak@18756 3 --- a/src/desktop.c
psychomaniak@18756 4 +++ b/src/desktop.c
psychomaniak@18756 5 @@ -3314,9 +3314,12 @@ static gboolean on_button_press(GtkWidget* w, GdkEventButton* evt)
psychomaniak@18756 6
psychomaniak@18756 7 if(evt->type == GDK_BUTTON_PRESS)
psychomaniak@18756 8 {
psychomaniak@18756 9 + /* ignore another buttons while some is in progress */
psychomaniak@18756 10 + if (self->button_pressed == 0)
psychomaniak@18756 11 + self->button_pressed = evt->button;
psychomaniak@18756 12 if(evt->button == 1) /* left button */
psychomaniak@18756 13 {
psychomaniak@18756 14 - self->button_pressed = TRUE; /* store button state for drag & drop */
psychomaniak@18756 15 + /* store button state for drag & drop */
psychomaniak@18756 16 self->drag_start_x = evt->x;
psychomaniak@18756 17 self->drag_start_y = evt->y;
psychomaniak@18756 18 }
psychomaniak@18756 19 @@ -3411,8 +3414,11 @@ static gboolean on_button_press(GtkWidget* w, GdkEventButton* evt)
psychomaniak@18756 20 gtk_tree_path_free(tp);
psychomaniak@18756 21 }
psychomaniak@18756 22 /* forward the event to root window */
psychomaniak@18756 23 - else if(evt->button != 1)
psychomaniak@18756 24 + else if(evt->button != 1 && evt->button == self->button_pressed)
psychomaniak@18756 25 + {
psychomaniak@18756 26 + self->forward_pending = TRUE;
psychomaniak@18756 27 forward_event_to_rootwin(gtk_widget_get_screen(w), (GdkEvent*)evt);
psychomaniak@18756 28 + }
psychomaniak@18756 29
psychomaniak@18756 30 if(! gtk_widget_has_focus(w))
psychomaniak@18756 31 {
psychomaniak@18756 32 @@ -3425,10 +3431,6 @@ static gboolean on_button_press(GtkWidget* w, GdkEventButton* evt)
psychomaniak@18756 33 static gboolean on_button_release(GtkWidget* w, GdkEventButton* evt)
psychomaniak@18756 34 {
psychomaniak@18756 35 FmDesktop* self = (FmDesktop*)w;
psychomaniak@18756 36 - GtkTreeIter it;
psychomaniak@18756 37 - FmDesktopItem* clicked_item = hit_test(self, &it, evt->x, evt->y);
psychomaniak@18756 38 -
psychomaniak@18756 39 - self->button_pressed = FALSE;
psychomaniak@18756 40
psychomaniak@18756 41 if(self->rubber_bending)
psychomaniak@18756 42 {
psychomaniak@18756 43 @@ -3442,17 +3444,21 @@ static gboolean on_button_release(GtkWidget* w, GdkEventButton* evt)
psychomaniak@18756 44 }
psychomaniak@18756 45 else if(fm_config->single_click && evt->button == 1)
psychomaniak@18756 46 {
psychomaniak@18756 47 + GtkTreeIter it;
psychomaniak@18756 48 + FmDesktopItem* clicked_item = hit_test(self, &it, evt->x, evt->y);
psychomaniak@18756 49 if(clicked_item)
psychomaniak@18756 50 - {
psychomaniak@18756 51 /* left single click */
psychomaniak@18756 52 fm_launch_file_simple(GTK_WINDOW(w), NULL, clicked_item->fi, pcmanfm_open_folder, w);
psychomaniak@18756 53 - return TRUE;
psychomaniak@18756 54 - }
psychomaniak@18756 55 }
psychomaniak@18756 56
psychomaniak@18756 57 /* forward the event to root window */
psychomaniak@18756 58 - if(! clicked_item)
psychomaniak@18756 59 - forward_event_to_rootwin(gtk_widget_get_screen(w), (GdkEvent*)evt);
psychomaniak@18756 60 + if (self->button_pressed == evt->button)
psychomaniak@18756 61 + {
psychomaniak@18756 62 + if (self->forward_pending)
psychomaniak@18756 63 + forward_event_to_rootwin(gtk_widget_get_screen(w), (GdkEvent*)evt);
psychomaniak@18756 64 + self->button_pressed = 0;
psychomaniak@18756 65 + self->forward_pending = FALSE;
psychomaniak@18756 66 + }
psychomaniak@18756 67
psychomaniak@18756 68 return TRUE;
psychomaniak@18756 69 }
psychomaniak@18756 70 --- a/src/desktop.h
psychomaniak@18756 71 +++ b/src/desktop.h
psychomaniak@18756 72 @@ -73,13 +73,14 @@ struct _FmDesktop
psychomaniak@18756 73 gint drag_start_x;
psychomaniak@18756 74 gint drag_start_y;
psychomaniak@18756 75 gboolean rubber_bending : 1;
psychomaniak@18756 76 - gboolean button_pressed : 1;
psychomaniak@18756 77 + gboolean forward_pending : 1;
psychomaniak@18756 78 gboolean dragging : 1;
psychomaniak@18756 79 gboolean layout_pending : 1;
psychomaniak@18756 80 guint idle_layout;
psychomaniak@18756 81 FmDndSrc* dnd_src;
psychomaniak@18756 82 FmDndDest* dnd_dest;
psychomaniak@18756 83 guint single_click_timeout_handler;
psychomaniak@18756 84 + guint button_pressed;
psychomaniak@18756 85 FmFolderModel* model;
psychomaniak@18756 86 guint cur_desktop;
psychomaniak@18756 87 gint monitor;
psychomaniak@18756 88 --
psychomaniak@18756 89 2.1.4
psychomaniak@18756 90