Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interactive: allow moving horizontally/vertically maximized window #2052

Merged
merged 2 commits into from
Aug 26, 2024

Conversation

tokyo4j
Copy link
Contributor

@tokyo4j tokyo4j commented Aug 7, 2024

Fixes #1521

Applies drag resistance unidirectionally for horizontally/vertically maximized windows, allowing them to be dragged without being untiled immediately.

While dragging a horizontally/vertically maximized window, edge/region snapping is disabled to prevent unintentional snapping and overlays.

The first commit stops unshading maximized/tiled views at the start of interactive move as it did't seem to be useful and caused flicker.

This PR also includes some refactoring to simplify the logic.

I'm totally fine delaying this PR after the next release. But I want to move forward the discussion below:

Discussion

As I said in IRC yesterday, I'm thinking of changing <snapping><dragResistance> to something like <resistance><snapOffThreshold> (or maybe <resistance><unSnapThreshold>) as <resistance> feels more suitable place for this setting. But while testing this PR, I started to think that it may be also useful to have another setting to configure the resistance for horizontally/vertically maximized windows as it requires more carefulness to drag them in one direction without un-tiling them.

What I came up with are:

  • <resistance><snapOffThreshold> - for normally maximized or tiled windows
  • <resistance><snapOffThresholdHVMaximized> - for horizontally/vertically maximized windows

Any ideas?

@tokyo4j tokyo4j changed the title 1d resistance interactive: allow moving horizontally/vertically maximized window Aug 7, 2024
@tokyo4j tokyo4j force-pushed the 1d-resistance branch 3 times, most recently from 2d679e4 to 7d48413 Compare August 7, 2024 15:33
@johanmalm
Copy link
Collaborator

I really like <resistance><unSnapThreshold> but am fine with either. It would be good to get that change in before the release.

Why do we need a different setting for the uni-directional maximized case? Is it because we're likely to need a greater threshold because people are unlikely to be able to drag vertically/horizontally in a "straight" line (i.e. straight within a tolerance plus/minus unSnapThreshold?

@tokyo4j
Copy link
Contributor Author

tokyo4j commented Aug 8, 2024

I really like but am fine with either. It would be good to get that change in before the release.

Opened #2056.

Is it because we're likely to need a greater threshold because people are unlikely to be able to drag vertically/horizontally in a "straight" line (i.e. straight within a tolerance plus/minus unSnapThreshold?

Yes. Not a strong preference though, as I don't usually unidirectionally maximize windows.

Maybe just using <resistance><unSnapThreshold> for normally/vertically/horizontally maximized windows is enough. KWin for example has a common threshold of (screen size) / 16 (ref).

@tokyo4j tokyo4j added this to the 0.8.1 milestone Aug 9, 2024
@johanmalm
Copy link
Collaborator

Is this one ready for final review?

@tokyo4j
Copy link
Contributor Author

tokyo4j commented Aug 17, 2024

Is this one ready for final review?

I'll do some refactors and ensure I don't break anything. I'll ping and mark this PR as ready for review when I finish it.

@tokyo4j tokyo4j mentioned this pull request Aug 18, 2024
Unshading a maximized/tiled window at the start of interactive move
doesn't seem to be useful and caused flicker.
@tokyo4j tokyo4j force-pushed the 1d-resistance branch 2 times, most recently from 2b5aad8 to f2e8c37 Compare August 21, 2024 16:09
@tokyo4j
Copy link
Contributor Author

tokyo4j commented Aug 21, 2024

@johanmalm Now ready for review!

@tokyo4j tokyo4j marked this pull request as ready for review August 21, 2024 16:11
@johanmalm
Copy link
Collaborator

Documentation rc.xml.all missing.

Have tested. Works really well 😄

Not looked through code yet (other than spotting that docs were missing).

@tokyo4j
Copy link
Contributor Author

tokyo4j commented Aug 22, 2024

Documentation rc.xml.all missing.

I hadn't added another configuration for resistance for horizontally/vertically maximized windows I suggested as <resistance><snapOffThresholdHVMaximized> because I didn't like its name and thought it can be added later.

Now I've added <resistance><unMaximizeThreshold> (default: 150) with documentation. It may be confusing that this is not applied for windows maximized in both direction, but I feel this name is much cleaner. I've added comments in rc.xml.all for explaining it and exaggerated it with bold letters in labwc-config.5.scd.

Applies drag resistance unidirectionally for horizontally/vertically
maximized windows, allowing them to be dragged without being untiled
immediately. When the distance of cursor movement orthogonal to the
maximized direction exceeds <resistance><unMaximizeThreshold>.

While dragging a horizontally/vertically maximized window, edge/region
snapping is disabled to prevent unintentional snapping and overlays.

This commit also includes some refactoring to simplify the logic.
@Consolatis
Copy link
Member

Tested and works great. Thanks!

@Consolatis Consolatis merged commit 1f1bdad into labwc:master Aug 26, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Window unmaximizes upon movement
3 participants