https://bugs.kde.org/show_bug.cgi?id=462276

            Bug ID: 462276
           Summary: Quick-tiling from half incorrectly moves window to
                    adjacent monitor
    Classification: Plasma
           Product: kwin
           Version: unspecified
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: multi-screen
          Assignee: kwin-bugs-n...@kde.org
          Reporter: natalie_clar...@yahoo.de
  Target Milestone: ---

SUMMARY
***
When a window is half-tiled on an a side that is adjacent to another screen,
and a combined keyboard shortcut is invoked to quarter-tile the window on the
same side, the window is incorrectly moved to the other screen.
***


STEPS TO REPRODUCE
1. Multi-monitor setup with screen A on the left and screen B on the right
2.  Quick-tile window to right half on screen A
3.  Meta+right+top to quick-tile the window to the right-top quarter

OBSERVED RESULT
Window is quick-tiled to top-right of screen B

EXPECTED RESULT
Window is quarter-tiled to top-right quarter of Screen A

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
The reason is that in
https://invent.kde.org/plasma/kwin/-/blob/master/src/placement.cpp#L832, quick
tiling gets invoked no matter if the combining timer has already timed out or
not. This means that combined shortcuts trigger quick tiling is twice, once
with only with the Right flag and once with the Right and Top flag. In the
first iteration, the window is already tiled half right and gets tiled half
right again, which causes
https://invent.kde.org/plasma/kwin/-/blob/master/src/window.cpp#L3833 to move
the window to the next screen. The next iteration with the Right and Top flags
then quick-tiles the window to the top-right of the screen it is currently on,
which by that time is already screen B.

I'm not sure how one would best solve this without delaying all quick tiling
until the combine timer timed out, which would annoyingly make all quick tiling
operations have a lag. Maybe one could delay only the screen moving until the
timer timed out and then readjust the tile to that screen's geometry.

Another possibility that would be better but I'm not sure is technically
possible would be to delay quick tiling until the modifier key is released. 
This would also have the advantage that the window doesn't briefly get tiled to
the the other half while pressing the first key in a combination (e.g.
Meta+top+right would briefly tile the window to the top half before it gets
tiled to the top-right quarter) and solve the problem with screen assignment,
but I don't understand the shortcut system well enough to tell whether this is
possible.

The bug can be worked around by pressing the arrow keys in the order such that
the first key is the side that doesn't have a screen adjacent, i.e.
Meta+top-right rather than Meta+right+top in the example given above, provided
that there aren't screens in both directions.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to