Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • KWin KWin
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 58
    • Issues 58
    • List
    • Boards
    • Service Desk
    • Milestones
  • Bugzilla
    • Bugzilla
  • Merge requests 162
    • Merge requests 162
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • PlasmaPlasma
  • KWinKWin
  • Merge requests
  • !1263

Consider only windows on current desktop when snapping them

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Vlad Zahorodnii requested to merge work/window-snap-current-desktop into master Aug 16, 2021
  • Overview 2
  • Commits 1
  • Pipelines 0
  • Changes 1

If a window is on several desktops, AbstractClient::desktop() will return the id of the last desktop.

For example, if a window is on virtual desktops A and B, the desktop() function will return the id of desktop B. This can be the culprit for bugs such as window snapping not working as expected when moving a window on virtual desktop A, e.g.

  • moved window is on desktops A, and C. desktop() returns the id of C
  • snap candidate (l) is on desktops A, and B. desktop() returns the id of B

Even though the snap candidate window and the moved window are both on the same desktop (A), the moved window won't be snapped because the desktop() function returns garbage values.

To fix that, the workspace needs to check whether the window is on the current desktop.

For what it's worth, that's also how the workspace handles windows being on multiple activities.

Edited Aug 16, 2021 by Vlad Zahorodnii
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: work/window-snap-current-desktop