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

Refactor X11 Application to make use of the new structure. #894

Merged
merged 13 commits into from
May 2, 2020

Conversation

xStrom
Copy link
Member

@xStrom xStrom commented Apr 30, 2020

#763 introduced a new instance based Application structure. This PR refactors the X11 Application code to make use of it, as well as adding better error reporting.

The windows map has reentrancy issues. Those were already there and this PR makes no attempt at solving them. I just merely refactored it to the new Application style.

@xStrom xStrom added S-needs-review waits for review shell/x11 concerns the X11 backend labels Apr 30, 2020
@xStrom
Copy link
Member Author

xStrom commented May 1, 2020

I also refactored Window to fix the reentrancy issues I was seeing. This means that multiple windows now work on X11! 🥳 I added a button to multiwin to create windows, because X11 doesn't have menus.

Partial invalidation is also really broken on master. Completely black window all the time broken. This made testing my changes here difficult so I ended up fixing that partially as well. The window is no longer black and partial invalidation sort of works.

There's still an issue that the still-valid areas get cleared during partial repaint. I'll see if I can fix it quickly, but otherwise I think that would be fine for a new PR too.

@luleyleo luleyleo self-requested a review May 1, 2020 16:13
@xStrom
Copy link
Member Author

xStrom commented May 1, 2020

I ended up fixing partial invalidation too. 🎉

Copy link
Collaborator

@luleyleo luleyleo left a comment

Choose a reason for hiding this comment

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

The X11 backend works A LOT better with this, thanks!

The inline comments aside I've found two issues:

  • Closing one window in the multiwin example closes all windows
  • Somtimes widgets disappear, for example hovering over a button in the list example makes the label next to it disappear, or in game_of_life the slider / buttons at the bottom vanish when hovering another one.

druid-shell/src/platform/x11/window.rs Outdated Show resolved Hide resolved
druid-shell/src/platform/x11/window.rs Outdated Show resolved Hide resolved
druid-shell/src/platform/x11/window.rs Outdated Show resolved Hide resolved
@xStrom xStrom added S-waiting-on-author waits for changes from the submitter and removed S-needs-review waits for review labels May 1, 2020
@xStrom
Copy link
Member Author

xStrom commented May 2, 2020

I added more logging and cleanup of windows after destruction. I also solved the partial invalidation issues in game_of_life and others. Those were caused by background painting outside the invalidated area.

The multiwin window closing issue is real but I couldn't find an easy fix. I looked into handling the WM_DELETE_WINDOW event but from what I gathered right now the xcb library we're using doesn't support that event. I'll open a separate issue for that.

@xStrom xStrom added S-needs-review waits for review and removed S-waiting-on-author waits for changes from the submitter labels May 2, 2020
Copy link
Collaborator

@luleyleo luleyleo left a comment

Choose a reason for hiding this comment

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

Looks all good now, thanks 👍

@luleyleo luleyleo removed the S-needs-review waits for review label May 2, 2020
@xStrom xStrom merged commit 2b10ce7 into linebender:master May 2, 2020
@xStrom xStrom deleted the application-x11 branch May 2, 2020 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
shell/x11 concerns the X11 backend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants