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

Implement custom_window_frame resize support example #3762

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dbuch
Copy link
Contributor

@dbuch dbuch commented Jan 1, 2024

It includes a convenience helper Into to map ResizeDirection to CursorIcon in Egui crate.

This is tested on linux with glow and wgpu.

Glow has a render glich best show by a video.
Glow Screencast
Where wgpu works fine
Wgpu Screencast

Closes #3761

@emilk
Copy link
Owner

emilk commented Jan 2, 2024

On macOS, custom_window_frame is already resizable on master.

I assume adding .with_resizable(true) to the ViewportBuilder is not enough on Linux?

If not, maybe we should implement this functionality directly into eframe instead?

@dbuch
Copy link
Contributor Author

dbuch commented Jan 2, 2024

On macOS, custom_window_frame is already resizable on master.

Cool, wonder if it works out-of-box on (Legacy) X11 compositor.

I assume adding .with_resizable(true) to the ViewportBuilder is not enough on Linux?

On wayland that seems to be the case. We have two modes of creating window decorations: Client/Server-side. Apparently winit opt for client side decoration mode with decoration disabled
platform_impl/linux/wayland/window

If not, maybe we should implement this functionality directly into eframe instead?

Totally agree 👍 this is certanly a workaround. So next step will be debug eframe and perhaps consult winit for wise advice 😄

I think I'll close this soon but I'd like to dig abit deeper

@dbuch dbuch marked this pull request as draft January 2, 2024 10:18
};

ui.output_mut(|o| o.cursor_icon = resize_direction.into());
if ui.input(|i| i.pointer.primary_pressed()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should stop send resize command when window is maximize, otherwise there will be a strange bug

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.

Resize window with custom_window_frame
3 participants