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

Ignore nested events in GTK shell #837

Merged
merged 3 commits into from
Apr 14, 2020

Conversation

luleyleo
Copy link
Collaborator

Now the GTK shell uses Mutex::try_borrow_mut and thus ignores nested events.

This Closes #735 and Closes #571

@luleyleo luleyleo added the S-needs-review waits for review label Apr 13, 2020
@xStrom
Copy link
Member

xStrom commented Apr 13, 2020

What happens to the event when it's ignored? Just dropped? I think a log_dropped_msg like the one in the Windows implementation would be a good idea here.

@luleyleo luleyleo force-pushed the gtk-ignore-nested-events branch from 78527d7 to 546c78c Compare April 14, 2020 10:23
druid-shell/src/platform/gtk/window.rs Outdated Show resolved Hide resolved
Comment on lines 482 to 502
log::warn!("bring_to_front_and_focus not yet implemented for gtk");
warn!("bring_to_front_and_focus not yet implemented for gtk");
Copy link
Member

Choose a reason for hiding this comment

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

I think @cmyr wants us to not use imported functions directly. That is log::warn! is better than warn!. It's from the Rust style guide.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I prefer that too, was just done differently in the Windows version I used as reference.
Wonder if there are lints for such things 🤔

Copy link
Member

Choose a reason for hiding this comment

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

Yeah the windows platform code has some of the oldest code in druid and so follows style the least.

I've been also thinking about looking into custom clippy/rustfmt options to enforce some of our style rules.

Copy link
Member

Choose a reason for hiding this comment

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

yea, this is a nit but I like macros and functions to be module-qualified. Would gladly accept a PR that standardizes on this :)

Copy link
Member

@xStrom xStrom left a comment

Choose a reason for hiding this comment

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

This might just change the problem, not solve it. However not crashing is an upgrade.

@luleyleo
Copy link
Collaborator Author

luleyleo commented Apr 14, 2020

Well, I still do not truly understand how how druid-shell works but from what I've seen I doubt this can be nicely solved without restructuring druid-shell. Also ignoring nested events does not really hurt the user experience as they are rare and do not matter in the cases where they occur.

@cmyr
Copy link
Member

cmyr commented Apr 14, 2020

yes, i think at least being defensive is the right decision for the time being.

Copy link
Member

@cmyr cmyr left a comment

Choose a reason for hiding this comment

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

👍

@luleyleo luleyleo merged commit 482ea62 into linebender:master Apr 14, 2020
luleyleo pushed a commit that referenced this pull request Apr 22, 2020
@xStrom xStrom removed the S-needs-review waits for review label May 15, 2020
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.

context menu pop up causes crash The SHOW_OPEN_PANEL command panics on gtk
3 participants