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/ draggable-region #92

Merged
merged 6 commits into from
Mar 25, 2021
Merged

feat/ draggable-region #92

merged 6 commits into from
Mar 25, 2021

Conversation

amrbashir
Copy link
Member

@amrbashir amrbashir commented Mar 1, 2021

I add a custom titlebar example mainly to test drag.

winit implementation will have to wait until this PR is merged.

@amrbashir amrbashir changed the title feat/ draggable-region (gtk-rs) feat/ draggable-region Mar 1, 2021
@nklayman
Copy link
Member

nklayman commented Mar 2, 2021

Awesome! This is super great to have.

src/application/gtkrs.rs Outdated Show resolved Hide resolved
@nklayman
Copy link
Member

nklayman commented Mar 2, 2021

I tested this out and it worked really well except for two things:

  1. In the example, the maximize button won't unmaximize
  2. When dragging the window, when I start moving the cursor the window jumps down by about 20px. For reference, I'm on Ubuntu 20.10 with Gnome 3.38.3 and nvidia drivers.

@amrbashir
Copy link
Member Author

amrbashir commented Mar 2, 2021

  1. In the example, the maximize button won't unmaximize
  2. When dragging the window, when I start moving the cursor the window jumps down by about 20px. For reference, I'm on Ubuntu 20.10 with Gnome 3.38.3 and nvidia drivers.
  1. Since there is no getters implemented on the WindowProxy I can't get the window state (maximized or not to fire apropriate event).

  2. I thought I fixed that last night, I will have to recheck it

@amrbashir
Copy link
Member Author

amrbashir commented Mar 2, 2021

I just checked it again and the 20px jump doesn't happen to me, I am using AwesomeWM though not Gnome or Kde so that doesn't count I guess.

Not sure why it jumps 20px on your end. Last night I did have the 20px jump but I managed to fix it by passing clientX and clientY from the mouse event to the callback then added these values to current window position.

@amrbashir
Copy link
Member Author

amrbashir commented Mar 2, 2021

@nklayman when you have a chance, can you try with the latest commit ? hopefully it is fixed

@nklayman
Copy link
Member

nklayman commented Mar 2, 2021

Seems like that did it, nice work!

@amrbashir
Copy link
Member Author

amrbashir commented Mar 2, 2021

Nice, we will have to wait for winit's PR to be merged though.

@nothingismagick
Copy link
Member

Didn't the PR get merged already @amrbashir
rust-windowing/winit#1840

@amrbashir
Copy link
Member Author

amrbashir commented Mar 15, 2021

Yeah it is merged but winit hasn't released a new version yet so I can't finish the PR unless they publish or wry uses winit from a git rev

@amrbashir amrbashir marked this pull request as ready for review March 19, 2021 19:48
@amrbashir amrbashir changed the base branch from master to dev March 19, 2021 19:50
@wusyong
Copy link
Member

wusyong commented Mar 21, 2021

I guess we can wait for next winit release? The PR can leave as is until then.

@amrbashir
Copy link
Member Author

Yeah it can wait, I just wanted to finish the PR while I can.

@wusyong
Copy link
Member

wusyong commented Mar 25, 2021

@amrbashir Could you update the winit dependency to the commit that has this feature?
I think we'll fork it and publish a non-aggressive crate version for tauri beta temporarily.

@nothingismagick
Copy link
Member

@amrbashir amrbashir requested a review from a team as a code owner March 25, 2021 16:43
@amrbashir amrbashir requested review from a team March 25, 2021 16:43
@wusyong wusyong merged commit b2a0bfc into tauri-apps:dev Mar 25, 2021
@amrbashir amrbashir deleted the feat/draggable-region branch March 25, 2021 17:31
@github-actions github-actions bot mentioned this pull request Mar 25, 2021
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.

4 participants