wok-6.x view pcmanfm/stuff/fix_desktop_menus.patch @ rev 20690
Update some WEB_SITE
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Jan 31 23:57:12 2019 +0100 (2019-01-31) |
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,9 +3314,12 @@ 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 - self->button_pressed = TRUE; /* store button state for drag & drop */
15 + /* store button state for drag & drop */
16 self->drag_start_x = evt->x;
17 self->drag_start_y = evt->y;
18 }
19 @@ -3411,8 +3414,11 @@ static gboolean on_button_press(GtkWidget* w, GdkEventButton* evt)
20 gtk_tree_path_free(tp);
21 }
22 /* forward the event to root window */
23 - else if(evt->button != 1)
24 + else if(evt->button != 1 && evt->button == self->button_pressed)
25 + {
26 + self->forward_pending = TRUE;
27 forward_event_to_rootwin(gtk_widget_get_screen(w), (GdkEvent*)evt);
28 + }
30 if(! gtk_widget_has_focus(w))
31 {
32 @@ -3425,10 +3431,6 @@ static gboolean on_button_press(GtkWidget* w, GdkEventButton* evt)
33 static gboolean on_button_release(GtkWidget* w, GdkEventButton* evt)
34 {
35 FmDesktop* self = (FmDesktop*)w;
36 - GtkTreeIter it;
37 - FmDesktopItem* clicked_item = hit_test(self, &it, evt->x, evt->y);
38 -
39 - self->button_pressed = FALSE;
41 if(self->rubber_bending)
42 {
43 @@ -3442,17 +3444,21 @@ static gboolean on_button_release(GtkWidget* w, GdkEventButton* evt)
44 }
45 else if(fm_config->single_click && evt->button == 1)
46 {
47 + GtkTreeIter it;
48 + FmDesktopItem* clicked_item = hit_test(self, &it, evt->x, evt->y);
49 if(clicked_item)
50 - {
51 /* left single click */
52 fm_launch_file_simple(GTK_WINDOW(w), NULL, clicked_item->fi, pcmanfm_open_folder, w);
53 - return TRUE;
54 - }
55 }
57 /* forward the event to root window */
58 - if(! clicked_item)
59 - forward_event_to_rootwin(gtk_widget_get_screen(w), (GdkEvent*)evt);
60 + if (self->button_pressed == evt->button)
61 + {
62 + if (self->forward_pending)
63 + forward_event_to_rootwin(gtk_widget_get_screen(w), (GdkEvent*)evt);
64 + self->button_pressed = 0;
65 + self->forward_pending = FALSE;
66 + }
68 return TRUE;
69 }
70 --- a/src/desktop.h
71 +++ b/src/desktop.h
72 @@ -73,13 +73,14 @@ struct _FmDesktop
73 gint drag_start_x;
74 gint drag_start_y;
75 gboolean rubber_bending : 1;
76 - gboolean button_pressed : 1;
77 + gboolean forward_pending : 1;
78 gboolean dragging : 1;
79 gboolean layout_pending : 1;
80 guint idle_layout;
81 FmDndSrc* dnd_src;
82 FmDndDest* dnd_dest;
83 guint single_click_timeout_handler;
84 + guint button_pressed;
85 FmFolderModel* model;
86 guint cur_desktop;
87 gint monitor;
88 --
89 2.1.4