Open ghost opened 3 years ago
That's likely related to your DE or window manager (is it KDE? looks like it).
I don't think anything can be done with this in GameHub. Maybe making the Settings dialog non-modal could fix it.
Yeah,I use Kde,but I never had an issue like that before. What does it mean if the window is non-modal? Sorry,my english is to bad and google translate can't help me lol
Try to do the same thing with other dialogs to see if the issue happens with them.
I tried it with right clicking a game the clicking properties and the same thing happens for that window.
Probably some weird interaction between KDE and GTK apps. I don't think it's a GameHub issue and it will likely happen in other GTK apps as well.
I tested it in Lutris (it uses GTK) and if I open a dialogue window thing it just behaves normal,for example this.
A video would be helpful, I don't fully understand what exactly is happening.
Here:
https://user-images.githubusercontent.com/68649672/103391538-47c11080-4b1a-11eb-96eb-59fd9106e868.mp4 [Quality is bad,cause if I record it with higher bitrate Github doesn't allow to upload it,cause of the big file size)
I'm having the same problem, most likely. I have a multi monitor setup, with 3 screens. My primary screen is the center one. It doesn't disappear, however. It just jumps to my right screen and the application, not just the settings window, becomes unresponsive. I can, however, close the settings window by pressing Escape, at which point the application is willing to receive (other) user input again.
The same thing happens with the Details and Game Properties windows. Except the Details window goes to my left screen, for some reason. I do have some special window settings enabled in KDE, but nothing that should affect GameHub. They only target specific executables I have selected.
I'll test it out in i3 as well. Will report back with an edit.
Edit: Works fine in i3. For good measure I installed OpenBox and tried it there as well, and also works fine. You're probably right in that it has something to do with KDE/Qt. Still, could this somehow be fixed?
Can you try the refactoring branch, there were some changes in the dialogs (mostly related to headerbars and removing some deprecated calls). Settings dialog is still modal there, but some others like game properties are not.
I have no idea how to fix this if that doesn't help, all dialogs are regular Gtk.Dialog
subclasses without anything special done to them. Maybe replacing them with Gtk.Window
can also help.
Also check if it happens with the web authentication window which is actually a Gtk.Window
, not a Gtk.Dialog
.
I compiled that branch and ran the new binary, and that fixed it (for me).
If by the web authentication window you mean the ones like logging in to GoG, that window is fine. I was able to move it around without issue in the one from the master
branch.
Also, might be useful to know, here is the terminal output when launching GameHub, opening the settings window, moving the settings window, closing the settings window and then closing the application when using master
branch:
[INFO] - GameHub
[INFO] Version: 0.16.0-84f789b-master
[INFO] Branch: master
[INFO] Commit: 84f789b84a1b0056b10029448ea6e15b4d94fadc
[INFO] - Environment
[INFO] Distro: Arch Linux
[INFO] DE: KDE
[INFO] GTK: 3.24.27
[INFO] Themes: Breeze-Dark | breeze-dark
(gamehub:45534): Gtk-WARNING **: 23:50:53.324: gtk_window_set_titlebar() called on a realized window
(gamehub:45534): Gtk-WARNING **: 23:50:54.194: gtk_widget_size_allocate(): attempt to allocate widget with width -3 and height 65492
(gamehub:45534): Gtk-WARNING **: 23:50:54.275: gtk_widget_size_allocate(): attempt to allocate widget with width -3 and height 65492
(gamehub:45534): Gtk-WARNING **: 23:50:54.291: gtk_widget_size_allocate(): attempt to allocate widget with width -3 and height 65492
When using the refactoring
branch version and doing the same thing, I only get this:
[INFO] - GameHub
[INFO] Version: 0.16.0-51dd7c8-refactoring
[INFO] Branch: refactoring
[INFO] Commit: 51dd7c89416ca863ca3917581917350a8d63a036
[INFO] - Environment
[INFO] Distro: Arch Linux
[INFO] DE: KDE
[INFO] GTK: 3.24.27
[INFO] Themes: Breeze-Dark | breeze-dark
Edit: Drat, it only seemed to have worked for the settings window. For the Game Details and Game Properties windows it's still bugging. Here is the log for trying to move the Game Details window:
[INFO] - GameHub
[INFO] Version: 0.16.0-51dd7c8-makepkg
[INFO] Branch: makepkg
[INFO] Commit: 51dd7c89416ca863ca3917581917350a8d63a036
[INFO] - Environment
[INFO] Distro: Arch Linux
[INFO] DE: KDE
[INFO] GTK: 3.24.27
[INFO] Themes: Breeze-Dark | breeze-dark
(gamehub:64786): Gtk-WARNING **: 00:14:34.378: gtk_window_set_titlebar() called on a realized window
[FATAL] game_hub_data_providers_data_igdb_parse: assertion 'json != NULL' failed
[FATAL] game_hub_data_providers_data_igdb_parse: assertion 'json != NULL' failed
[FATAL] game_hub_data_providers_data_igdb_parse: assertion 'json != NULL' failed
(gamehub:64786): Gtk-WARNING **: 00:14:35.955: gtk_widget_size_allocate(): attempt to allocate widget with width -3 and height 65492
(gamehub:64786): Gtk-WARNING **: 00:14:36.059: gtk_widget_size_allocate(): attempt to allocate widget with width -3 and height 65492
Yes, this time around I altered the gamehub-git
package from the Arch User Repository to download from the refactoring
branch and ran makepkg -si
. The settings window still worked fine after that, though, so I don't think I messed anything up with that.
@MikauSchekzen maybe it's somehow related to the fact that dialogs can't be moved separately from the parent window in GNOME.
Can you try to change Dialog
to Window
in https://github.com/tkashkin/GameHub/blob/51dd7c89416ca863ca3917581917350a8d63a036/src/ui/dialogs/GamePropertiesDialog/GamePropertiesDialog.vala#L29
and remove , use_header_bar: 1
in https://github.com/tkashkin/GameHub/blob/51dd7c89416ca863ca3917581917350a8d63a036/src/ui/dialogs/GamePropertiesDialog/GamePropertiesDialog.vala#L38
If you have the refactoring branch installed, you can clone the repo, do changes, build and run it without installing:
meson build
cd build
ninja
./src/com.github.tkashkin.gamehub --debug --verbose
Unfortunately, that caused it to error on the step where I run ninja
. Output:
warning: `GLIB_2_62' is already defined
warning: `GLIB_2_XX' defines are automatically added up to targeted glib version
warning: `GLIB_2_56' is already defined
warning: `GLIB_2_XX' defines are automatically added up to targeted glib version
../src/ui/views/GameDetailsView/blocks/Description.vala:87.35-87.74: warning: `Gtk.StyleContext.get_background_color' has been deprecated since 3.16
../src/ui/dialogs/GamePropertiesDialog/GamePropertiesDialog.vala:47.28-47.41: error: The name `get_header_bar' does not exist in the context of `GameHub.UI.Dialogs.GamePropertiesDialog.GamePropertiesDialog'
headerbar = (HeaderBar) get_header_bar();
^^^^^^^^^^^^^^
../src/ui/dialogs/GamePropertiesDialog/GamePropertiesDialog.vala:72.4-72.19: error: The name `get_content_area' does not exist in the context of `GameHub.UI.Dialogs.GamePropertiesDialog.GamePropertiesDialog'
get_content_area().add(stack);
^^^^^^^^^^^^^^^^
../src/ui/dialogs/GameDetailsDialog.vala:69.4-69.18: warning: `Gtk.Dialog.get_action_area' has been deprecated since 3.12
../src/ui/dialogs/GameDetailsDialog.vala:70.4-70.18: warning: `Gtk.Dialog.get_action_area' has been deprecated since 3.12
Compilation failed: 2 error(s), 7 warning(s)
ninja: build stopped: subcommand failed.
I commented out the lines causing the error, after which it did compile. However, it then crashes once I open the Game Properties window in the application itself. Here's the output in the terminal afterwards:
[DEBUG] [Database.migrate] Latest db version: 12, current: 12
[DEBUG] [Compat.init] wine: '/home/tijmen/.local/share/lutris/runners/wine/lutris-6.0-rc1-x86_64/bin/wine'; version: '6.0rc1.r0.gd7b71f0b ( TkG Staging Esync Fsync )'
[DEBUG] [Compat.init] wine: '/home/tijmen/.local/share/lutris/runners/wine/lutris-5.2-x86_64/bin/wine'; version: '5.2.r1.g8b2fd051 ( TkG Staging Esync Fsync )'
[DEBUG] [Compat.init] wine: '/home/tijmen/.local/share/lutris/runners/wine/lutris-6.0-x86_64/bin/wine'; version: '6.0.r0.g2414b1da ( TkG Staging Esync Fsync )'
[DEBUG] [Compat.init] wine: '/usr/bin/wine'; version: '6.2.r0.g3b5ea332 ( TkG Staging Esync Fsync )'
[DEBUG] [Compat.init] proton: '/home/tijmen/.local/share/Steam/compatibilitytools.d/proton-tkg-6.1/proton'; version: 'tkg-6.1.r0.gf6dacd2f.release'
[DEBUG] [Compat.init] proton: '/home/tijmen/.local/share/Steam/steamapps/common/Proton - Experimental/proton'; version: 'experimental-5.13-20210311'
[DEBUG] [Compat.init] proton: '/home/tijmen/.local/share/Steam/steamapps/common/Proton 3.7/proton'; version: '1539178925'
[DEBUG] [Compat.init] proton: '/home/tijmen/.local/share/Steam/compatibilitytools.d/proton-tkg-6.2/proton'; version: 'tkg-6.2.r0.g3b5ea332.release'
[INFO] - GameHub
[INFO] Version: 0.16.0-51dd7c8-refactoring
[INFO] Branch: refactoring
[INFO] Commit: 51dd7c89416ca863ca3917581917350a8d63a036
[INFO] - Environment
[INFO] Distro: Arch Linux
[INFO] DE: KDE
[INFO] GTK: 3.24.27
[INFO] Themes: Breeze-Dark | breeze-dark
[DEBUG] [GOG] Loading games: page 1 of 1
[DEBUG] [GOG] Imported tag: COMPLETED (168657544)
[DEBUG] [GOG] Imported tag: NEXT TO PLAY (120816994)
[DEBUG] [GOG] Imported tag: BACKLOG (72976444)
[DEBUG] [GOG] Imported tag: FAVORITE (25135894)
(com.github.tkashkin.gamehub:69648): Gtk-WARNING **: 00:37:47.866: gtk_window_set_titlebar() called on a realized window
[FATAL] game_hub_data_providers_data_igdb_parse: assertion 'json != NULL' failed
[FATAL] game_hub_data_providers_data_igdb_parse: assertion 'json != NULL' failed
[FATAL] game_hub_data_providers_data_igdb_parse: assertion 'json != NULL' failed
(com.github.tkashkin.gamehub:69648): Gtk-WARNING **: 00:37:49.722: gtk_widget_size_allocate(): attempt to allocate widget with width -3 and height 65492
(com.github.tkashkin.gamehub:69648): Gtk-WARNING **: 00:37:50.482: gtk_widget_size_allocate(): attempt to allocate widget with width -3 and height 65492
Segmentation fault (core dumped)
Without knowing more than a fraction about GTK programming, I'm not sure if I can try something else on my own, so I might need your advice again in getting this test run to work.
@MikauSchekzen try to:
headerbar = (HeaderBar) get_header_bar();
with headerbar = new HeaderBar();
set_titlebar(headerbar);
after line 50get_content_area().add(stack);
with add(stack);
This should probably be enough. If it isn't enough try to do it like in https://github.com/tkashkin/GameHub/blob/51dd7c89416ca863ca3917581917350a8d63a036/src/ui/windows/WebAuthWindow.vala
After performing the above steps, the Game Properties window opens again. However, it seems to still bug out.
Two changes that I did notice:
Not sure if that window helps, though.
The output of the new test:
[DEBUG] [Database.migrate] Latest db version: 12, current: 12
[DEBUG] [Compat.init] wine: '/home/tijmen/.local/share/lutris/runners/wine/lutris-6.0-rc1-x86_64/bin/wine'; version: '6.0rc1.r0.gd7b71f0b ( TkG Staging Esync Fsync )'
[DEBUG] [Compat.init] wine: '/home/tijmen/.local/share/lutris/runners/wine/lutris-5.2-x86_64/bin/wine'; version: '5.2.r1.g8b2fd051 ( TkG Staging Esync Fsync )'
[DEBUG] [Compat.init] wine: '/home/tijmen/.local/share/lutris/runners/wine/lutris-6.0-x86_64/bin/wine'; version: '6.0.r0.g2414b1da ( TkG Staging Esync Fsync )'
[DEBUG] [Compat.init] wine: '/usr/bin/wine'; version: '6.2.r0.g3b5ea332 ( TkG Staging Esync Fsync )'
[DEBUG] [Compat.init] proton: '/home/tijmen/.local/share/Steam/compatibilitytools.d/proton-tkg-6.1/proton'; version: 'tkg-6.1.r0.gf6dacd2f.release'
[DEBUG] [Compat.init] proton: '/home/tijmen/.local/share/Steam/steamapps/common/Proton - Experimental/proton'; version: 'experimental-5.13-20210311'
[DEBUG] [Compat.init] proton: '/home/tijmen/.local/share/Steam/steamapps/common/Proton 3.7/proton'; version: '1539178925'
[DEBUG] [Compat.init] proton: '/home/tijmen/.local/share/Steam/compatibilitytools.d/proton-tkg-6.2/proton'; version: 'tkg-6.2.r0.g3b5ea332.release'
[INFO] - GameHub
[INFO] Version: 0.16.0-51dd7c8-refactoring
[INFO] Branch: refactoring
[INFO] Commit: 51dd7c89416ca863ca3917581917350a8d63a036
[INFO] - Environment
[INFO] Distro: Arch Linux
[INFO] DE: KDE
[INFO] GTK: 3.24.27
[INFO] Themes: Breeze-Dark | breeze-dark
[DEBUG] [GOG] Loading games: page 1 of 1
[DEBUG] [GOG] Imported tag: COMPLETED (168657544)
[DEBUG] [GOG] Imported tag: NEXT TO PLAY (120816994)
[DEBUG] [GOG] Imported tag: BACKLOG (72976444)
[DEBUG] [GOG] Imported tag: FAVORITE (25135894)
(com.github.tkashkin.gamehub:82609): Gtk-WARNING **: 01:53:48.466: Negative content width -11 (allocation 1, extents 6x6) while allocating gadget (node headerbar, owner GtkHeaderBar)
(com.github.tkashkin.gamehub:82609): Gtk-WARNING **: 01:53:48.467: gtk_widget_size_allocate(): attempt to allocate widget with width -94 and height 36
(com.github.tkashkin.gamehub:82609): Gtk-WARNING **: 01:53:48.467: Negative content width -23 (allocation 1, extents 12x12) while allocating gadget (node label, owner GtkLabel)
(com.github.tkashkin.gamehub:82609): Gtk-WARNING **: 01:53:48.467: Negative content width -23 (allocation 1, extents 12x12) while allocating gadget (node label, owner GtkLabel)
(com.github.tkashkin.gamehub:82609): Gtk-CRITICAL **: 01:53:48.467: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkNotebook
(com.github.tkashkin.gamehub:82609): Gtk-WARNING **: 01:53:49.961: Negative content width -11 (allocation 1, extents 6x6) while allocating gadget (node headerbar, owner GtkHeaderBar)
(com.github.tkashkin.gamehub:82609): Gtk-WARNING **: 01:53:49.961: gtk_widget_size_allocate(): attempt to allocate widget with width -94 and height 36
(com.github.tkashkin.gamehub:82609): Gtk-WARNING **: 01:53:49.961: Negative content width -23 (allocation 1, extents 12x12) while allocating gadget (node label, owner GtkLabel)
(com.github.tkashkin.gamehub:82609): Gtk-WARNING **: 01:53:49.961: Negative content width -23 (allocation 1, extents 12x12) while allocating gadget (node label, owner GtkLabel)
Well, I have no idea what's wrong. I guess I'll have to install KDE and test everything.
Is there any significant info about your environment other than it's GTK 3.24.27 on KDE on Arch? Xorg or Wayland? GPU, driver?
Hang on, I might be on to something. I went and compared the GamePropertiesDialog source with the SettingsDialog source. I tried a few things, and in the end, changing the constructor of GamePropertiesDialog from
Object(resizable: false, use_header_bar: 1, title: game.name, game: game);
to
Object(transient_for: Windows.MainWindow.instance, resizable: false, use_header_bar: 1, title: game.name, game: game);
and building the project again made it work without bugs.
In case it's still necessary, I'm using the Xorg version of KDE Plasma, I have an AMD 5700 XT, and I'm using the normal mesa drivers on Arch Linux (not the -git
variant).
Edit: Before I tried changing things I reverted the inheritance back to Dialog for GamePropertiesDialog. Probably also useful to tell, in hindsight.
Edit 2: GameDetailsDialog already had that extra bit in the constructor, yet that one's still having problems.
Interesting, looks like dialogs require a parent window to be set on KDE, otherwise moving them causes weird bugs. I haven't noticed anything similar in GNOME or Pantheon.
GTK docs (and Valadoc) suggest dialogs should be set as transient for a parent window, but I haven't seen it as a hard requirement anywhere.
Edit 2: GameDetailsDialog already had that extra bit in the constructor, yet that one's still having problems.
GameDetailsDialog
doesn't really have a fixed size, maybe that's the problem, I'm not sure.
You can try to add resizable: false
to the dialog, or set details_view.expand
/hexpand
/vexpand
to false
, or request a bigger size in content.set_size_request()
to see if that helps.
Alright, after trying your suggestions (which unfortunately didn't work) and some more messing about, I came to the following conclusion:
GameDetailsDialog also stopped bugging once one of the following was true:
use_header_bar: 1
in the constructor and adding the appropriate variable and constructor content)resizable
was set to true in the constructor (it was false before)It also seems to work if both options are used.
So if I move that window it just vanishes and if I press Alt+F4 it's closed,but not the whole gamehub. And I can't see that window in my task bar.