Community
Participate
Working Groups
Created attachment 287587 [details] Window size isn't correct Hi all, I created a Shell, and populate its content, open the window. But I got the following error cause my App size isn't correct. (It seems that the assertion aborted following-up code execution, so the size remains the default. ``` (JavaEmbeddedFrame:7354): Gtk-CRITICAL **: 14:12:26.084: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed ``` OS: Linux Ubuntu 20.10 x86_64 FYI, as I tested, in Ubuntu 20.04, the same code, has no such assertion error and the window size is correct.
Please provide version of gtk3 library on Ubuntu 21.10 & simple snippet to reproduce.
Also please try with latest SWT available (looks like you are on 4.18).
Correction: OS: Linux Ubuntu 21.10 x86_64 GTK version: $ dpkg -l libgtk2.0-0 libgtk-3-0 | grep libgtk ii libgtk-3-0:amd64 3.24.30-1ubuntu1 amd64 GTK graphical user interface library ii libgtk2.0-0:amd64 2.24.33-2ubuntu1 amd64 GTK graphical user interface library - old version
Created attachment 287588 [details] Sample code
Created attachment 287589 [details] Ubuntu 21.10 sample code run screen snapshot
@Andrey Loskutov Sample code are included in **Attachments**
Run with Ubuntu 21.10 and SWT I20211128-1800 (Latest build)
(In reply to X L from comment #4) > Created attachment 287588 [details] > Sample code Works fine for me on RHEL 7.9 / GTK 3.22 / SWT master, however I use X11 and I don't run on HiDPI screen (which you seem to use). Could you please try on X11 & on non-HiDPI screen? Could be either GTK 3.24.30 or Wayland or HiDPI support issue.
My config is Ubuntu 21.10(GNOME) and a 4k screen(100% and 200% scaling) can produce this bug
> Could be either GTK 3.24.30 or Wayland or HiDPI support issue. Is there any workaround I can do to solve this bug? (We have a massive quantity of users which run those code)
(In reply to X L from comment #10) > > Could be either GTK 3.24.30 or Wayland or HiDPI support issue. > > > Is there any workaround I can do to solve this bug? > (We have a massive quantity of users which run those code) No idea. Are you using Wayland or X11? May be switching to another would help? I assume you have evaluated Ubuntu 21.10 before moving to it? Now it is most likely too late for workarounds, and downgrading to older GTK version will be not possible I guess :-( Unfortunately I don't have yet environment with 3.24.30 GTK3 to play with.
I tried a few configurations on my Fedora 35 GTK 3.24.30 environment. At 4k 200% I don't get any errors running with GDK_BACKEND=x11 or with Wayland. At non-hi dpi resolutions I don't get any critical/warning logs either. However, I do notice that in Wayland, the window size is completely incorrect, as in, much smaller than specified within the code provided. Using GDK_BACKEND=x11, the window is the correct. @X L: Is it possible for you to press CTRL-SHIFT-I then under the "General" tab then let us know what GDK Backend you're running on?
Thank you all! I've checked, the default WM is Wayland in Ubuntu 21.10, I didn't change anything, just stick with the default config. ``` $ env | grep ^XDG_ XDG_CURRENT_DESKTOP=ubuntu:GNOME XDG_MENU_PREFIX=gnome- XDG_SESSION_DESKTOP=ubuntu XDG_RUNTIME_DIR=/run/user/1000 XDG_SESSION_TYPE=wayland XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/var/lib/snapd/desktop XDG_SESSION_CLASS=user ``` And switch to X11 can solve my problem `GDK_BACKEND=x11 java -cp .:./swt.jar Main` > and downgrading to older GTK version will be not possible I guess :-( Impractical I'm afraid since it's bundled with Ubuntu 21.10 by default, end-user have no such experience to do such heavy work though.
Created attachment 289114 [details] Sample code update 2023
SWT project switched to using Github https://github.com/eclipse-platform/eclipse.platform.swt and almost no one looks at bugzilla anymore. Please consider providing your snippet as a JUnit test via a PR that might even lead to a fix for the issue.
FYI, I can fix this bug (as a workaround) by adding the `SWT.RESIZE` to the window style, and the window will appear as its `setSize(x, y)` size.