Middle-click titlebar actions (like maximizing vertically) don't work (for all apps in Wayland sessions, and CSD apps in Xorg sessions)

Bug #1698083 reported by Daniel van Vugt on 2017-06-15
60
This bug affects 9 people
Affects Status Importance Assigned to Milestone
gnome-shell (Ubuntu)
Medium
Unassigned
gtk+3.0 (Ubuntu)
Medium
Unassigned
mutter (Ubuntu)
Medium
Unassigned

Bug Description

Upstream: https://gitlab.gnome.org/GNOME/gtk/issues/539

In Gnome Tweak Tool you can configure vertical maximizing for:
  Windows > Titlebar Actions > Middle-Click
However this feature seems to get ignored in Wayland sessions (it just maximizes fully instead). It only works correctly in Xorg Gnome sessions.

ProblemType: Bug
DistroRelease: Ubuntu 17.10
Package: gnome-shell 3.24.2-0ubuntu6
ProcVersionSignature: Ubuntu 4.10.0-22.24-generic 4.10.15
Uname: Linux 4.10.0-22-generic x86_64
ApportVersion: 2.20.5-0ubuntu4
Architecture: amd64
Date: Thu Jun 15 14:46:04 2017
DisplayManager: lightdm
InstallationDate: Installed on 2017-05-03 (43 days ago)
InstallationMedia: Ubuntu 17.10 "Artful Aardvark" - Alpha amd64 (20170502)
SourcePackage: gnome-shell
UpgradeStatus: No upgrade log present (probably fresh install)

Daniel van Vugt (vanvugt) wrote :
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gnome-shell (Ubuntu):
status: New → Confirmed
Daniel van Vugt (vanvugt) wrote :

Seems to have started working in the past week or so. :)

Changed in gnome-shell (Ubuntu):
status: Confirmed → Fix Released
Daniel van Vugt (vanvugt) wrote :

I take it back. It works randomly, sometimes.

Possibly related to Gnome Tweak Tool > Windows > Titlebar Actions, but that does not seem to do what it's meant to reliably either.

Changed in gnome-shell (Ubuntu):
status: Fix Released → Confirmed
Daniel van Vugt (vanvugt) wrote :

Aha! It appears this feature only works in Xorg sessions ("Ubuntu") and not in "Ubuntu on Wayland" sessions.

summary: - Vertically maximize on middle button click
+ Vertically maximize on middle button click does not work in Wayland
+ sessions

OK, so there are a few steps to fixing this bug:

1. sudo apt install gnome-tweak-tool
2. Gnome Tweak Tool > Windows > Titlebar Actions > Middle-Click = Toggle Maximize Vertically
3. Log in using Xorg ("Ubuntu") for it to work (not "Ubuntu on Wayland").

Step #3 sounds like an obvious bug. But #2 is seemingly also a bug because it interprets the middle click anywhere on the titlebar -- clicking on the maximize button is not considered a special area.

Daniel van Vugt (vanvugt) wrote :

It appears all middle-click titlebar actions don't work when in a Wayland session.

summary: - Vertically maximize on middle button click does not work in Wayland
- sessions
+ Middle-click titlebar actions don't work in Wayland sessions
description: updated
Jeremy Bicha (jbicha) on 2017-07-17
tags: added: wayland
summary: - Middle-click titlebar actions don't work in Wayland sessions
+ Middle-click titlebar actions (like maximizing vertically) don't work in
+ Wayland sessions
Changed in gnome-shell (Ubuntu):
importance: Wishlist → Medium
Changed in mutter (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium

Actually this bug is only GTK apps on Wayland, so -> https://bugzilla.gnome.org/show_bug.cgi?id=746273

It works in non-GTK apps like Chromium.

Changed in gtk+3.0 (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
description: updated
Changed in gtk:
importance: Unknown → Wishlist
status: Unknown → Confirmed
tags: added: session
tags: added: wayland-session
removed: session
sojusnik (sojusnik) wrote :

I'm using Ubuntu 17.10 and this bug is still present with Xorg AND Wayland.

Apps with a "normal" GTK titlebar (the narrow one), like Firefox, are working according to the settings in Gnome Tweak. So a double- or middle-click on the titlebar maximizes the window f.i. vertically. But when an app has a "Gnome" titlebar (the broad one), f.i. Gedit, then the window is always maximized fully, not only vertically or horizontally.

You can download a screencast of this bug here: https://mega.nz/#!j5BSjaSL!o7E3Kuf061sJQ_tUukpe-3Tf4JTi7NExB3uI-z_ijX4

It shows the behavior of different apps, GTK and QT, with different titlebars:

Deluge (GTK): works
Qpdfview (QT): works
LibreOffice (GTK): works
Gnome Tweak: fails
Gedit: fails

Can somebody confirm this?

Would be great to have a fix soon, since this bug is around for years!

Daniel van Vugt (vanvugt) wrote :

Yes I can confirm that. But I think it should be discussed in a different bug report.

sojusnik (sojusnik) wrote :

Why is this another bug?

Daniel van Vugt (vanvugt) wrote :

Because middle click actions do work in Xorg sessions, and only fail in Wayland. If you find something is broken in a Xorg session then it is not this bug.

Daniel van Vugt (vanvugt) wrote :

Sorry, I was wrong.

It seems the bug is in GTK's titlebar logic. For Xorg sessions that's only used in "modern" apps with the thick headerbar. For Wayland sessions, that's used in all apps.

Joseph Maillardet (jokx) wrote :

Observation on Ubuntu 18.04 :
- All work good on Xorg session
- Problem only affect Wayland session
- Classic windows with traditional decoration (chromium, pidgin, inkscape, ...) accept middle-click action
- GTK3 apps with Headerbar decoration who use CSD (Client Side Decoration) ignores middle-click
- Don't know why, but Evolution 3.28.1-2 ignores middle-click too (but have traditional decoration !)

Freedesktop talk about that since December 2016 : https://lists.freedesktop.org/archives/wayland-devel/2016-December/thread.html#32028

Daniel van Vugt (vanvugt) wrote :

We know it's broken (and more so in Wayland sessions). For more up to date information, please see the upstream bug instead:

  https://bugzilla.gnome.org/show_bug.cgi?id=746273

That's where any fix will occur first.

Changed in gtk:
status: Confirmed → Expired
sojusnik (sojusnik) wrote :

Please change it to "confirmed". That's still a relevant issue.

Daniel van Vugt (vanvugt) wrote :

"Expired" is a misnomer. It just moved to https://gitlab.gnome.org/GNOME/gtk/issues/539

Since we can't change that status, and shouldn't, I have just removed the gtk task. See the above link instead.

no longer affects: gtk
description: updated
summary: - Middle-click titlebar actions (like maximizing vertically) don't work in
- Wayland sessions
+ Middle-click titlebar actions (like maximizing vertically) don't work
+ (for all apps in Wayland sessions, and some apps in Xorg sessions)
summary: Middle-click titlebar actions (like maximizing vertically) don't work
- (for all apps in Wayland sessions, and some apps in Xorg sessions)
+ (for all apps in Wayland sessions, and CSD apps in Xorg sessions)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.