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

IntelliJ/CLion using X11 backend renders incorrectly on resize #3570

Open
tarek-y-ismail opened this issue Aug 23, 2024 · 4 comments · May be fixed by #3587
Open

IntelliJ/CLion using X11 backend renders incorrectly on resize #3570

tarek-y-ismail opened this issue Aug 23, 2024 · 4 comments · May be fixed by #3587
Assignees
Labels
bug triaged Triage into JIRA to plan it in XWayland

Comments

@tarek-y-ismail
Copy link
Contributor

How to reproduce

  1. Open up IntelliJ/CLion
  2. Try resizing the window, you'll see two different behaviors:
    If you enlarge or shrink the window, you'll see the UI update, but the rendering will be still confined to the old boundaries
intellij-shenanigans.mp4
@AlanGriffiths
Copy link
Contributor

Hmm. I've not seen this, but I've been using the preview Wayland support for the past few weeks

@tarek-y-ismail tarek-y-ismail changed the title IntelliJ/CLion rendering breaks on resize IntelliJ/CLion using X11 backend renders incorrectly on resize Aug 23, 2024
@AlanGriffiths
Copy link
Contributor

Hmm. I've not seen this, but I've been using the preview Wayland support for the past few weeks

I can confirm the above weirdness. I wonder if it is related to the clipping mentioned in #3560 (comment)

@tarek-y-ismail
Copy link
Contributor Author

Happens as far back as 2.13 (can't get earlier versions to build)

@tarek-y-ismail tarek-y-ismail self-assigned this Sep 5, 2024
@tarek-y-ismail
Copy link
Contributor Author

tarek-y-ismail commented Sep 5, 2024

So I found the cause of the bug. If you watch the video, you'll see it happening with only vertical or horizontal resizing and not corner resizing (although that's broken as well).

The culprit was these few lines:

if (spec.value()->width.is_set() &&
spec.value()->width.value() == scene_surface->content_size().width)
spec.value()->width.consume();
if (spec.value()->height.is_set() &&
spec.value()->height.value() == scene_surface->content_size().height)
spec.value()->height.consume();

Which broke this conversion from shell::SurfaceSpecification to miral::WindowSpecification:

if (spec.width.is_set() && spec.height.is_set())
size = Size(spec.width.value(), spec.height.value());

The most apparent solution is to consume both the width and height if they're both equal to the current content size, otherwise, both pass even if one hasn't changed. Another solution would be to modify the logic of miral::WindowSpecification to allow width and height to be set separately, but that'll probably open up another can of worms that is probably better left closed

This also exhibits something similar to #3560 and corner resizing, where resizing stops immediately once the cursor leaves the application window. In #3560, this manifests by not being able to resize at all as the widgets are outside the visible window.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug triaged Triage into JIRA to plan it in XWayland
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants