wok-current diff pcmanfm/stuff/fix_desktop_menus.patch @ rev 25278

updated reptyr (0.7.0 -> 0.9.0)
author Hans-G?nter Theisgen
date Mon Jul 18 14:55:21 2022 +0100 (2022-07-18)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/pcmanfm/stuff/fix_desktop_menus.patch	Mon Jul 18 14:55:21 2022 +0100
     1.3 @@ -0,0 +1,90 @@
     1.4 +Commit: http://git.lxde.org/gitweb/?p=lxde/pcmanfm.git;a=commit;h=ae7ed3af651041a5538634ac9e35dc479e280ad9
     1.5 +We revert it to fix desktop Openbox menus: Cannot open Right-click and Middle-Click menu in same time.
     1.6 +--- a/src/desktop.c
     1.7 ++++ b/src/desktop.c
     1.8 +@@ -3314,9 +3314,12 @@ static gboolean on_button_press(GtkWidget* w, GdkEventButton* evt)
     1.9 + 
    1.10 +     if(evt->type == GDK_BUTTON_PRESS)
    1.11 +     {
    1.12 ++        /* ignore another buttons while some is in progress */
    1.13 ++        if (self->button_pressed == 0)
    1.14 ++            self->button_pressed = evt->button;
    1.15 +         if(evt->button == 1)  /* left button */
    1.16 +         {
    1.17 +-            self->button_pressed = TRUE;    /* store button state for drag & drop */
    1.18 ++            /* store button state for drag & drop */
    1.19 +             self->drag_start_x = evt->x;
    1.20 +             self->drag_start_y = evt->y;
    1.21 +         }
    1.22 +@@ -3411,8 +3414,11 @@ static gboolean on_button_press(GtkWidget* w, GdkEventButton* evt)
    1.23 +             gtk_tree_path_free(tp);
    1.24 +     }
    1.25 +     /* forward the event to root window */
    1.26 +-    else if(evt->button != 1)
    1.27 ++    else if(evt->button != 1 && evt->button == self->button_pressed)
    1.28 ++    {
    1.29 ++        self->forward_pending = TRUE;
    1.30 +         forward_event_to_rootwin(gtk_widget_get_screen(w), (GdkEvent*)evt);
    1.31 ++    }
    1.32 + 
    1.33 +     if(! gtk_widget_has_focus(w))
    1.34 +     {
    1.35 +@@ -3425,10 +3431,6 @@ static gboolean on_button_press(GtkWidget* w, GdkEventButton* evt)
    1.36 + static gboolean on_button_release(GtkWidget* w, GdkEventButton* evt)
    1.37 + {
    1.38 +     FmDesktop* self = (FmDesktop*)w;
    1.39 +-    GtkTreeIter it;
    1.40 +-    FmDesktopItem* clicked_item = hit_test(self, &it, evt->x, evt->y);
    1.41 +-
    1.42 +-    self->button_pressed = FALSE;
    1.43 + 
    1.44 +     if(self->rubber_bending)
    1.45 +     {
    1.46 +@@ -3442,17 +3444,21 @@ static gboolean on_button_release(GtkWidget* w, GdkEventButton* evt)
    1.47 +     }
    1.48 +     else if(fm_config->single_click && evt->button == 1)
    1.49 +     {
    1.50 ++        GtkTreeIter it;
    1.51 ++        FmDesktopItem* clicked_item = hit_test(self, &it, evt->x, evt->y);
    1.52 +         if(clicked_item)
    1.53 +-        {
    1.54 +             /* left single click */
    1.55 +             fm_launch_file_simple(GTK_WINDOW(w), NULL, clicked_item->fi, pcmanfm_open_folder, w);
    1.56 +-            return TRUE;
    1.57 +-        }
    1.58 +     }
    1.59 + 
    1.60 +     /* forward the event to root window */
    1.61 +-    if(! clicked_item)
    1.62 +-        forward_event_to_rootwin(gtk_widget_get_screen(w), (GdkEvent*)evt);
    1.63 ++    if (self->button_pressed == evt->button)
    1.64 ++    {
    1.65 ++        if (self->forward_pending)
    1.66 ++            forward_event_to_rootwin(gtk_widget_get_screen(w), (GdkEvent*)evt);
    1.67 ++        self->button_pressed = 0;
    1.68 ++        self->forward_pending = FALSE;
    1.69 ++    }
    1.70 + 
    1.71 +     return TRUE;
    1.72 + }
    1.73 +--- a/src/desktop.h
    1.74 ++++ b/src/desktop.h
    1.75 +@@ -73,13 +73,14 @@ struct _FmDesktop
    1.76 +     gint drag_start_x;
    1.77 +     gint drag_start_y;
    1.78 +     gboolean rubber_bending : 1;
    1.79 +-    gboolean button_pressed : 1;
    1.80 ++    gboolean forward_pending : 1;
    1.81 +     gboolean dragging : 1;
    1.82 +     gboolean layout_pending : 1;
    1.83 +     guint idle_layout;
    1.84 +     FmDndSrc* dnd_src;
    1.85 +     FmDndDest* dnd_dest;
    1.86 +     guint single_click_timeout_handler;
    1.87 ++    guint button_pressed;
    1.88 +     FmFolderModel* model;
    1.89 +     guint cur_desktop;
    1.90 +     gint monitor;
    1.91 +-- 
    1.92 +2.1.4
    1.93 +