SLADE icon indicating copy to clipboard operation
SLADE copied to clipboard

Entry Preview Covers UI

Open inventor200 opened this issue 2 years ago • 23 comments

SLADE Version: 3.2.0 Operating System: Linux (Ubuntu 22.04)

Issue Details: If I click on an entry (such as PLAYPAL or any map entry), the preview is at max-scale, and completely covers all of the other entries (and most of the UI for the rest of the program), preventing me from clicking on any other entry. Sometimes the rest of the uncovered UI becomes unresponsive, and I need to force-close the program, but it's still able to ask me if I want to save my work. From this, I know that it's not entirely locked up, but all buttons and functions are completely blocked by the entry preview.

This happens for entries of all types. The previous release version worked reliably-well on my system.

inventor200 avatar Apr 23 '22 03:04 inventor200

If possible, can you post a screenshot of the issue?

sirjuddington avatar Apr 23 '22 08:04 sirjuddington

Absolutely. This is my first time attaching a file here, so hopefully this uploads and opens correctly.

The screenshot is me opening the freedoom2.wad, and selecting the MAP01 entry. If I try to click below the preview to reach other entries, it registers as clicking on the preview still.

Happy to add any other needed information.

Screenshot from 2022-04-23 21-41-38

inventor200 avatar Apr 24 '22 01:04 inventor200

Hmm I think it might be to do with the OpenGL canvas - does it happen with text entries?

How did you get SLADE - from the drd repository, the flatpak or did you build it yourself?

Also do you have fractional scaling enabled in the display settings? It might be that the wxWidgets version in your build doesn't properly support gtk fractional scaling.

sirjuddington avatar Apr 24 '22 03:04 sirjuddington

Text entries seem to render perfectly well.

I believe it's from the DRD repo? I went into terminal and entered in "apt install slade", so it's a tracked package on my system for automatic updates and such. I don't remember if I had to add DRD as a package source to do that. Otherwise I'm pretty sure it's not a flatpak, and I know I didn't build it myself.

I do not have fractional scaling enabled. Display scale is at 100%.

EDIT: My ADHD-ridden memory fails me yet again. I did have to add the DRD repository. I used these instructions when I first downloaded it last year.

Screenshot from 2022-04-24 05-48-50

inventor200 avatar Apr 24 '22 09:04 inventor200

That's really weird then, it looks like it is the right size, but it's putting it at the very top left of the parent panel instead of where it should be in the layout. What happens if you resize the window?

sirjuddington avatar Apr 24 '22 12:04 sirjuddington

Text-based entries are totally fine, and everything resizes as expected.

Screenshot from 2022-04-24 17-14-21

For other entry types, such as MAP01 from freedoom2.wad, it shows the preview getting smaller (while still obstructing the other entries as before). Another weird side-effect of this, though: the actual Slade window does not change size (like it does when resizing the program with a text entry open), and now I can neither hover nor click the maximize button or the close button of the window's header bar.

After attempting this resize, I do not have the ability to hover over the edge of the window (where the cursor usually becomes a drag icon). However, if I move my cursor steadily towards the center of the screen, it will arrive upon the spot where the edge SHOULD be (which visibly is inside an empty part of the preview window). When it reaches this invisible edge, the drag icon appears, as the hover event correctly fires according to the internal model of the window. From here, the drag icon continues to persist while I walk the cursor towards the far edge of the screen again. As I move the cursor to the center of the screen, the drag icon disappears again after I cross the internally-modeled edge of the resized window.

Screenshot from 2022-04-24 17-14-48

(While I am not familiar with the code base, I'm willing to bet that the window's internal model thinks that it achieved a smaller size, and is no longer maximized. However, whatever is handling the rendering for the window failed to update and redraw the window at its correct size. Probably, if I clicked enough times in the empty space where the maximize button or close button SHOULD be, I would eventually find where the internal model THINKS the buttons are positioned now, and the window would close or maximize as expected. This is just speculation, but an error like this once happened in one of my projects a few years ago. I could be totally wrong, though.)

When I close the window (by right-clicking the Slade icon in the taskbar, and selecting "close"), it does the normal close operations ("Are you sure you want to exit Slade?" modal pops up and works perfectly). When I re-open Slade, it is now at the correct reduced size, even after the bugs and lack of apparent size change when previewing MAP01.

Screenshot from 2022-04-24 17-32-27

I tried moving the divider between the entries list and the preview area after selecting MAP01 for preview. When moving to the right, the map preview gets smaller, but does not change position. However, the width of the entries list also does not change, and the divider does not visibly move while dragging. When I stop dragging, the cursor icon stays in place, despite not hovering over the visible divider anymore.

When dragging this divider with a text entry previewed, everything behaves entirely as expected.

I'm happy to perform more tests and report back as needed.

inventor200 avatar Apr 24 '22 21:04 inventor200

It looks like something is going really wrong with the window manager - I just noticed you listed ubuntu 22.04 as your OS, is that correct? If so it was just released a few days ago and I'm wondering if there might be some issues between wxWidgets/OpenGL and whatever newer version of GTK/Wayland etc it's using

UPDATE: Yep that's what it is, I just installed 22.04 in a VM and can reproduce the issue

sirjuddington avatar Apr 25 '22 00:04 sirjuddington

Yeah, I'm using X11 and Gnome still; haven't switched to Wayland.

Figured it was my Linux. I have a Windows VM on it, and the Slade 3.2.0 runs fine on that. The problem is all my asset creation tools are on the Linux, so I would need to truck the project back and forth between the VM and the host, and that would be a pain in my workflow.

inventor200 avatar Apr 25 '22 03:04 inventor200

Looking into it more, #1352 seems to fix the issue, though I'm not exactly sure why. I was a bit reluctant to put that in for 3.2.1 since it's a fairly major change, but might need to rethink that now

sirjuddington avatar Apr 25 '22 05:04 sirjuddington

Forgive me, as I'm new to a lot of this side of the GitHub process (I usually just push to private repos).

With #1352 fixing the bug, do I mark this closed, or will you...? Do I download and build the version with #1352 and write back to confirm, or is it not something to download...?

I just want to make sure I know what to do from here, in there's anything else I can help with or need to provide for the process. I know, for example, StackOverflow requires the original poster to mark something as complete for the responses to count toward something.

I thank you for your patience and hard work. Doom modders on Linux deeply value the Slade 3 program.

inventor200 avatar Apr 25 '22 08:04 inventor200

You can just leave it for now - it looks like #1352 doesn't actually fix it, or at least not always - it's started spontaneously happening on my laptop now even with that change, so I have absolutely no idea what it could be unfortunately

sirjuddington avatar Apr 25 '22 08:04 sirjuddington

Alrighty; I shall leave it, then. Thank you again for all that you do!

inventor200 avatar Apr 25 '22 08:04 inventor200

Ok I've found a workaround - GDK_BACKEND needs to be set to x11, so you will have to run slade from a terminal like:

GDK_BACKEND=x11 slade

This works for me at least, even without #1352

sirjuddington avatar Apr 25 '22 11:04 sirjuddington

Aha, excellent! Works perfectly on my end as well, too! Need to save this into a bash script somewhere so I remember to run it this way from now on.

inventor200 avatar Apr 25 '22 20:04 inventor200

For anyone else who might find this thread when searching the Internet, you can implement the workaround in a .desktop file (Slade's is found in /usr/share/applications/Slade.desktop).

Change the exec line to the following: Exec=env GDK_BACKEND=x11 slade

This will allow you to keep your taskbar icon and application list icon the same, and you can click them as you used to before when opening Slade, but now it opens it with the GDK workaround!

EDIT: If you simply change it to: Exec=GDK_BACKEND=x11 slade then it will throw an error, vanish your icon from your taskbar and application list, and not open, because it reads GDK_BACKEND as the name of a program, and not an environment variable. I had to do some searching around to figure out how to implement sirjuddington's workaround, as I was liable to lapse into old habits for simply clicking on the .desktop file.

inventor200 avatar Apr 25 '22 20:04 inventor200

I have this issue when using Slade 3.2.1 under Plasma Wayland session: Screenshot_20221024_000333

axredneck avatar Oct 23 '22 21:10 axredneck

Same on Wayland+Sway.

Possibly a wxWidgets bug? There was a recent fix related to OpenGL canvas positioning on Wayland there, but I tried it and it doesn't appear to fix SLADE: https://github.com/wxWidgets/wxWidgets/commit/800d6ed69b9f6b909a36304ebddb52047c691838

I tried adding some printf's to that place on wxWidgets and it seems to get the right coordinates, but the canvas stays at its initial position for some reason.

joanbm avatar Dec 14 '22 23:12 joanbm

Works fine for me now. Fixed?

axredneck avatar Feb 16 '23 00:02 axredneck

Works fine for me now. Fixed?

Still reproduces for me on SLADE 3.2.1 on Arch Linux (updated with recent packages, e.g. GTK 3.24.36, wxWidgets 3.2.2.1, wlroots 0.16.2 + Sway 1.8.1, etc.).

joanbm avatar Feb 16 '23 00:02 joanbm

The problem where the entry preview is placed over the list of entries (as seen in https://github.com/sirjuddington/SLADE/issues/1351#issuecomment-1107683199) appears to be related to the "Start Page" tab.

The "Start Page" tab is a WebView, which internally creates an OpenGL context, and it seems to have some bad interaction with the OpenGL context used for the entry preview, I haven't figured out what's going on yet.

If I disable it (uncheck Edit -> Preferences -> Interface -> "Show Start Page on Startup" and restart), the entry preview is properly placed.

However, even with that workaround, it's still unusable due to another issue: https://github.com/wxWidgets/wxWidgets/issues/22580 where the entry preview canvas doesn't hide after changing to another entry.

joanbm avatar Aug 24 '23 21:08 joanbm

SLADE should work on native Wayland under wxWidgets 3.2.3 (which includes this fix) as long as you disable "Show Start Page on Startup" on Preferences and restart.

The problem with the "Start Page" is a GTK3 issue, related to GTK issue 5392 and fixed in GTK4 but not GTK3. I have a backport in the works but I haven't been able to submit it there yet.

joanbm avatar Oct 12 '23 12:10 joanbm

Can confirm that without the start page wxWidgets 3.2.3 is working under Wayland. It's unfortunate there's a GTK bug too since it probably means it will be some time before I can enable native Wayland in the deb package even if a backport goes in upstream.

Blzut3 avatar Oct 13 '23 03:10 Blzut3

Disabling the "Start Page" seems to also fix the entire UI no longer updating when attempting to preview any graphics lumps, or double clicking on a TEXTURES lump to open the TEXTUREx Editor, under Wayland.

SteelT1 avatar Dec 04 '23 20:12 SteelT1