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

feat: Window resizing support #194

Open
3 tasks done
dklassic opened this issue Oct 9, 2024 · 6 comments
Open
3 tasks done

feat: Window resizing support #194

dklassic opened this issue Oct 9, 2024 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@dklassic
Copy link
Collaborator

dklassic commented Oct 9, 2024

Currently due to the defaulting decoration-less behavior of verso, we lack several window features including the ability for users to resize the window dynamically on Windows and Linux (macOS works fine). Adding window resizing support will improve user interaction, allowing users to adjust the browser window size to their preference by dragging the window edges or corners.

Expected Behavior:

  • Users should be able to resize the window by clicking and dragging the edges or corners.
  • The window size should adjust smoothly to match the mouse movements.
  • Resizing should function properly on all supported operating systems (Windows and Linux).
  • Supports both horizontal and vertical resizing, as well as corner-based diagonal resizing.

Technical Approach:

  • Enable resizing functionality through native window APIs.
  • Monitor mouse events (mousedown, mousemove, and mouseup) around the edges and corners to trigger resizing.

Acceptance Criteria:

  • Users can resize the window by dragging its edges or corners.
  • Resizing behaves consistently across different operating systems.
  • Display corresponding cursor icon when on edges or corners.

Good To Haves:

  • To ensure resizing actions are smooth and responsive to user input.
  • To ensure that minimum and maximum window size constraints are respected during resizing.
  • To ensure compatibility with other UI elements, such as buttons and menus, to prevent unintended resizing interactions.
  • Resizing may cause flickering to the window itself which should be addressed in the future
@dklassic dklassic added the enhancement New feature or request label Oct 9, 2024
@pewsheen
Copy link
Collaborator

Add double click on panel to toggle maximize window (still in progress, will keep update here)

versotile-org/verso-panel#8

@pewsheen pewsheen self-assigned this Oct 21, 2024
@wusyong
Copy link
Member

wusyong commented Oct 27, 2024

Although macOS works fine by default in resize.
We should make sure the behaviour is still the same after our implementation.
I tried to test it after the commit of resizing PR and it seems to still work fine on msOS:

Screen.Recording.2024-10-27.at.7.28.38.PM.mov

@wusyong
Copy link
Member

wusyong commented Oct 28, 2024

Here's windows' resizing. Note that the black background is due to opengl from my device. Wgl can display transparent background.
Perhaps we could make the gl more configurable in the future.

windows-resize.mp4

@pewsheen
Copy link
Collaborator

Linux:

wayland_resize.mp4

@wusyong
Copy link
Member

wusyong commented Nov 5, 2024

I'm working on smooth resizing for weeks. And here are some solid result on Linux. I'll send the PR once I make sure all platforms are smooth.

Screencast.from.2024.11.05.20.45.20.webm

@wusyong
Copy link
Member

wusyong commented Nov 5, 2024

And here's macOS:

Screen.Recording.2024-11-05.at.8.39.58.PM.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants