GNOME Bugzilla – Bug 701610
GTK2 Adwaita engine does not allow dragging windows by menu bar or toolbar
Last modified: 2018-05-02 15:40:26 UTC
The new GTK2 Adwaita engine looks quite good, and helps GTK2 apps fit in on a GNOME 3 desktop. However, I noticed that while it follows the GTK3 style where the menu bar blends into the title bar, it does not behave the same as that style: you can only grab and drag the window by the title bar, not by the menu bar or toolbar. Now that both GTK2 and GTK3 apps look the same, the difference in UX behavior becomes more of a problem.
I think this might be a limitation in GTK2 itself and outside the control of the theme.
Other GTK2 themes allow for menubar dragging, but that functionality depends on the theme engine IIRC.
The GTK 2 version of Adwaita has, since 3.6, included the ability to drag the menubar and toolbar. You can see this in the beginning of the gtkrc with GtkMenuBar::window-dragging and GtkToolbar::window-dragging both set to 1. This is, in fact, a shortcoming in the vanilla GTK 2 library, as it doesn't support this feature. Many mainstream distros such as Fedora and Ubuntu distribute a patched version of GTK 2 that makes full use of this. If dragging doesn't work with Adwaita, then it wouldn't be working in any other themes, either.
(In reply to comment #3) > The GTK 2 version of Adwaita has, since 3.6, included the ability to drag the > menubar and toolbar. You can see this in the beginning of the gtkrc with > GtkMenuBar::window-dragging and GtkToolbar::window-dragging both set to 1. > > This is, in fact, a shortcoming in the vanilla GTK 2 library, as it doesn't > support this feature. Many mainstream distros such as Fedora and Ubuntu > distribute a patched version of GTK 2 that makes full use of this. If dragging > doesn't work with Adwaita, then it wouldn't be working in any other themes, > either. Interesting. Any chance of that patch getting into upstream?
I'll look into it, although you should know that GTK 2 is only being maintained at the moment- no new features. However, the diffs for the patches I've seen are fairly small, just 30 lines or so, so I don't imagine it would be too painstaking to get in. In fact, I should find out if there's already a bug open for it.
I think this issue is fixed. At least I can drag windows by mouse on header bar, menu bar and tool bar on gnome 3.18.x
(In reply to Christian Stadelmann from comment #6) > I think this issue is fixed. At least I can drag windows by mouse on header > bar, menu bar and tool bar on gnome 3.18.x With stock upstream GTK, or a distribution-patched version as mentioned in comment 3?
I just retested with GTK+ 2.24.28 and four different GTK+2 applications (gimp, celestia, higan, and firefox), none of which allowed dragging by the menu bar.
With adwaita-gtk2-theme package version 3.18.0-1.fc23 from Fedora. See https://pkgs.fedoraproject.org/cgit/gnome-themes-standard.git/tree/?h=f23 for the spec file. Only change is the gtkrc file with these contents: gtk-theme-name = "Adwaita" gtk-icon-theme-name = "gnome" gtk-cursor-theme-name = "Adwaita" gtk-button-images = 0 gtk-menu-images = 0 Otherwise they are just packaging the .tar.xz file from http://download.gnome.org/sources/gnome-themes-standard/3.18/, so I'd call it stock upstream. But they patch their gtk2 (2.24.28) version with a file called "window-dragging.patch", see https://pkgs.fedoraproject.org/cgit/gtk2.git/tree/?h=f23 So this issue is not fixed in stock gtk2, sorry. But at least there is a working patch lying around.
Is there any reason for the patch not to be merged when it's used by major stable distributions?
OK this is now obselete, the theme no longer allows this and neither does the gtk3 version.
(In reply to Juraj Fiala from comment #11) > OK this is now obselete, the theme no longer allows this and neither does > the gtk3 version. When did this stop working in gtk3?
(In reply to Josh Triplett from comment #12) > (In reply to Juraj Fiala from comment #11) > > OK this is now obselete, the theme no longer allows this and neither does > > the gtk3 version. > > When did this stop working in gtk3? I don't remember it working to be frank, it definitely does not in 3.20, but I just heard today (after marking this) that it's a regression.
I can confirm the regression as of GTK+ 3.20.6. (Easy test case: gnome-terminal with "Show Menubar" enabled.) It definitely worked in gnome-terminal before. > I just heard today (after marking this) that it's a regression. Do you have a bug number for that? And is this a regression in GTK3 or in the Adwaita theme? Either way, this should be reopened.
Yeah, you're right. I don't have a bug number, but I'll try asking around.
OK I added this back to the theme but this is a gtk2 issue.
We're moving to gitlab! As part of this move, we are moving bugs to NEEDINFO if they haven't seen activity in more than a year. If this issue is still important to you and still relevant with GTK+ 3.22 or master, please reopen it and we will migrate it to gitlab.
This issue is still present on Gtk+ 2 applications.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/426.