wok-next view pcmanfm/stuff/patches/fix_desktop_menus.patch @ rev 19925

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