wok rev 18756

pcmanfm: patch to fix openbox menu
author Xander Ziiryanoff <psychomaniak@xakep.ru>
date Mon Dec 28 20:47:30 2015 +0000 (2015-12-28)
parents ce8561c19cb9
children ef4ed701a27f
files pcmanfm/receipt pcmanfm/stuff/fix_desktop_menus.patch
line diff
     1.1 --- a/pcmanfm/receipt	Sun Dec 27 23:15:58 2015 +0200
     1.2 +++ b/pcmanfm/receipt	Mon Dec 28 20:47:30 2015 +0000
     1.3 @@ -27,6 +27,7 @@
     1.4  # Rules to configure and make the package.
     1.5  compile_rules()
     1.6  {
     1.7 +	patch -p1 -R -i $stuff/fix_desktop_menus.patch
     1.8  	patch -p1 -i $stuff/pcmanfm-network-icon.patch
     1.9  	./autogen.sh
    1.10  	./configure $CONFIGURE_ARGS &&
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/pcmanfm/stuff/fix_desktop_menus.patch	Mon Dec 28 20:47:30 2015 +0000
     2.3 @@ -0,0 +1,90 @@
     2.4 +Commit: http://git.lxde.org/gitweb/?p=lxde/pcmanfm.git;a=commit;h=ae7ed3af651041a5538634ac9e35dc479e280ad9
     2.5 +We revert it to fix desktop Openbox menus: Cannot open Right-click and Middle-Click menu in same time.
     2.6 +--- a/src/desktop.c
     2.7 ++++ b/src/desktop.c
     2.8 +@@ -3314,9 +3314,12 @@ static gboolean on_button_press(GtkWidget* w, GdkEventButton* evt)
     2.9 + 
    2.10 +     if(evt->type == GDK_BUTTON_PRESS)
    2.11 +     {
    2.12 ++        /* ignore another buttons while some is in progress */
    2.13 ++        if (self->button_pressed == 0)
    2.14 ++            self->button_pressed = evt->button;
    2.15 +         if(evt->button == 1)  /* left button */
    2.16 +         {
    2.17 +-            self->button_pressed = TRUE;    /* store button state for drag & drop */
    2.18 ++            /* store button state for drag & drop */
    2.19 +             self->drag_start_x = evt->x;
    2.20 +             self->drag_start_y = evt->y;
    2.21 +         }
    2.22 +@@ -3411,8 +3414,11 @@ static gboolean on_button_press(GtkWidget* w, GdkEventButton* evt)
    2.23 +             gtk_tree_path_free(tp);
    2.24 +     }
    2.25 +     /* forward the event to root window */
    2.26 +-    else if(evt->button != 1)
    2.27 ++    else if(evt->button != 1 && evt->button == self->button_pressed)
    2.28 ++    {
    2.29 ++        self->forward_pending = TRUE;
    2.30 +         forward_event_to_rootwin(gtk_widget_get_screen(w), (GdkEvent*)evt);
    2.31 ++    }
    2.32 + 
    2.33 +     if(! gtk_widget_has_focus(w))
    2.34 +     {
    2.35 +@@ -3425,10 +3431,6 @@ static gboolean on_button_press(GtkWidget* w, GdkEventButton* evt)
    2.36 + static gboolean on_button_release(GtkWidget* w, GdkEventButton* evt)
    2.37 + {
    2.38 +     FmDesktop* self = (FmDesktop*)w;
    2.39 +-    GtkTreeIter it;
    2.40 +-    FmDesktopItem* clicked_item = hit_test(self, &it, evt->x, evt->y);
    2.41 +-
    2.42 +-    self->button_pressed = FALSE;
    2.43 + 
    2.44 +     if(self->rubber_bending)
    2.45 +     {
    2.46 +@@ -3442,17 +3444,21 @@ static gboolean on_button_release(GtkWidget* w, GdkEventButton* evt)
    2.47 +     }
    2.48 +     else if(fm_config->single_click && evt->button == 1)
    2.49 +     {
    2.50 ++        GtkTreeIter it;
    2.51 ++        FmDesktopItem* clicked_item = hit_test(self, &it, evt->x, evt->y);
    2.52 +         if(clicked_item)
    2.53 +-        {
    2.54 +             /* left single click */
    2.55 +             fm_launch_file_simple(GTK_WINDOW(w), NULL, clicked_item->fi, pcmanfm_open_folder, w);
    2.56 +-            return TRUE;
    2.57 +-        }
    2.58 +     }
    2.59 + 
    2.60 +     /* forward the event to root window */
    2.61 +-    if(! clicked_item)
    2.62 +-        forward_event_to_rootwin(gtk_widget_get_screen(w), (GdkEvent*)evt);
    2.63 ++    if (self->button_pressed == evt->button)
    2.64 ++    {
    2.65 ++        if (self->forward_pending)
    2.66 ++            forward_event_to_rootwin(gtk_widget_get_screen(w), (GdkEvent*)evt);
    2.67 ++        self->button_pressed = 0;
    2.68 ++        self->forward_pending = FALSE;
    2.69 ++    }
    2.70 + 
    2.71 +     return TRUE;
    2.72 + }
    2.73 +--- a/src/desktop.h
    2.74 ++++ b/src/desktop.h
    2.75 +@@ -73,13 +73,14 @@ struct _FmDesktop
    2.76 +     gint drag_start_x;
    2.77 +     gint drag_start_y;
    2.78 +     gboolean rubber_bending : 1;
    2.79 +-    gboolean button_pressed : 1;
    2.80 ++    gboolean forward_pending : 1;
    2.81 +     gboolean dragging : 1;
    2.82 +     gboolean layout_pending : 1;
    2.83 +     guint idle_layout;
    2.84 +     FmDndSrc* dnd_src;
    2.85 +     FmDndDest* dnd_dest;
    2.86 +     guint single_click_timeout_handler;
    2.87 ++    guint button_pressed;
    2.88 +     FmFolderModel* model;
    2.89 +     guint cur_desktop;
    2.90 +     gint monitor;
    2.91 +-- 
    2.92 +2.1.4
    2.93 +