Bug 361241 - Double click to maximize does not work in some situations
Summary: Double click to maximize does not work in some situations
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: core (other bugs)
Version First Reported In: 5.6.1
Platform: Exherbo Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 361480 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-03-31 17:50 UTC by Bernd Steinhauser
Modified: 2017-06-22 05:07 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.10.3
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bernd Steinhauser 2016-03-31 17:50:55 UTC
As mentioned in bug 360137, I sometimes see the issue of kwin not responding to a double click on the window title decoration, which in my setup should maximize the window.
I finally was able to find a way to reliably reproduce (see below) the issue and track it down.
I was already pointed at
https://quickgit.kde.org/?p=kwin.git&a=commit&h=ed1d32288b50647469fb0e000f21b849e286ca36
and indeed that commit causes the issue to appear.
For reference, see bug 357450, which was fixed by the referenced commit.
bug 345473 seems unrelated as I'm only seeing the problem under certain circumstance, most of the time it works.

Reproducible: Always

Steps to Reproduce:
1. Open a window, ensure it is not maximized.
2. Double click on the title, the window should maximize as expected
3. Double click to unmaximize, should work as expected
4. Click on the desktop containment / desktop background
5. Click on the window title once(!), don't move the cursor
6. Wait for at least 0.2 s
7. Double click on the window title, no response
From here on, it doesn't seem to work reliably:
8. Wait for a second
9. Double click again, no response
etc.



• Only double click seems to be affected. Right click/wheel etc. work as expected.
• The action that is linked to double click does not matter, shade etc. behave the same.
• I chose "Happens every time", but I'm not sure if it is 100%, at least with the procedure above I can reproduce it at least 9 times out of 10.
• The "Don't move the cursor" part is not strictly necessary, but it seems to me like it increases the chance for this to happen. But I've seen it with moving the cursor as well and I even saw this with  clicking inside a textbox while the app is active like this one right here and then trying again, thus I think the trigger has something to do with the app changing focus.
• If you don't double click but instead triple click, the window will maximize.
Comment 1 Bernd Steinhauser 2016-03-31 17:53:19 UTC
Forgot to mention:
I ran kwin at commit id ed1d32288b50647469fb0e000f21b849e286ca36 to test this.
When using kwin at 95cbd7c1b3cdbe81fdee1682049bd08ab7fe99fb (parent), I cannot reproduce it at all (or at least the above does not work when trying about 10 times).

Also present in 5.6.1.
Comment 2 Thomas Lübking 2016-03-31 20:37:44 UTC
Looking at the patch, I seem to have messed it on resolving a merge conflict (wrong indentention/linebreak and it actually doesn't make any sense the way it is)

@Martin, better don't wait for me to push this.



diff --git a/abstract_client.cpp b/abstract_client.cpp
index b323030..aab929f 100644
--- a/abstract_client.cpp
+++ b/abstract_client.cpp
@@ -1406,14 +1406,13 @@ bool AbstractClient::processDecorationButtonPress(QMouseEvent *event, bool ignor
             const quint64 interval = m_decoration.doubleClickTimer.elapsed();
             m_decoration.doubleClickTimer.invalidate();
             if (interval > QGuiApplication::styleHints()->mouseDoubleClickInterval()) {
-                m_decoration.doubleClickTimer.invalidate(); // expired -> new first click and pot. init
+                m_decoration.doubleClickTimer.start(); // expired -> new first click and pot. init
             } else {
                 Workspace::self()->performWindowOperation(this, options->operationTitlebarDblClick());
                 dontMoveResize();
                 return false;
             }
-        }
-         else {
+        } else {
             m_decoration.doubleClickTimer.start(); // new first click and pot. init, could be invalidated by release - see below
         }
     }
Comment 3 Bernd Steinhauser 2016-04-01 15:32:24 UTC
That fixes the problem, thanks.
Comment 4 Thomas Lübking 2016-04-07 00:55:09 UTC
*** Bug 361480 has been marked as a duplicate of this bug. ***
Comment 5 Allan 2016-05-20 16:49:45 UTC
A similar scenario, KDE 5.6.4 (Archlinux).

Double click titlebar to lower, is configured, i find that:

- Triple click is needed in 5.6.4 when just entering the window and not manipulating it beforehand.
- Not in 5.5.5, so a regression.
- Funnily double click to lower works- when the window is first dragged or has it’s border clicked once (not titlebar).
Comment 6 Martin Flöser 2016-08-27 15:58:57 UTC
was that integrated?
Comment 7 Bernd Steinhauser 2016-08-27 19:14:55 UTC
At least on my system (5.7.x) I can't reproduce the bug anymore.
Comment 8 FabiB 2016-08-28 12:13:30 UTC
on my system (5.7.3) the bug is still there (but i'm using "to minimize" by double click) so maybe its a different case
Comment 9 Allan 2016-08-28 12:27:06 UTC
$ kwin_x11 --version
kwin 5.7.3

Doubleclick to lower, bug still there, more often than not -tripleclick is needed.
Comment 10 Allan 2016-09-29 14:06:13 UTC
$ kwin_x11 --version
kwin 5.7.5

Easiest way to replicate the issue of not detecting double click:
1. Setup Double-click: to "Lower" under "Titlebar" and Left button: to "Raise" "Active" under "Titlebar & Frame"
2. Have a window with visible titlebar below another window.
3. Click the titlebar to bring it to front, double click it to bring it lower, this may actually work the first time.
4. Repeat step 3 to notice. :)
Comment 11 Allan 2016-10-10 13:50:12 UTC
$ kwin_x11 --version
kwin 5.8.0
Bug is still there.

I recommend my previous post for the easiest way to reproduce it.
Comment 12 Martin Koller 2017-01-03 15:19:32 UTC
can still reproduce it like explained in comment#0
with kwin 5.8.3 (openSuse 42.2)
I have configured to minimize by double click.
Decoration is Breeze.
Comment 13 MitraX 2017-06-21 21:07:02 UTC
The issue is still here.

ENVIRONMENT:
Platform: KDE Neon
KDE Plasma Version: 5.10.2
KDE Framework Version: 5.35.0
Qt Version: 5.9.0
Comment 14 Martin Flöser 2017-06-22 05:07:34 UTC
Git commit 152be60cc04f81fb54fdbe0afec41470aa188d54 by Martin Flöser.
Committed on 22/06/2017 at 05:07.
Pushed by graesslin into branch 'Plasma/5.10'.

Fix double click on window deco if tripple clicked

Patch by Thomas Lübking which got lost in bugs.kde.org.
FIXED-IN: 5.10.3

M  +1    -1    abstract_client.cpp

https://commits.kde.org/kwin/152be60cc04f81fb54fdbe0afec41470aa188d54