wails icon indicating copy to clipboard operation
wails copied to clipboard

[Linux] Gdk-CRITICAL **: 22:17:45.455: gdk_window_get_origin: assertion 'GDK_IS_WINDOW (window)' failed

Open ianmjones opened this issue 2 years ago • 9 comments

Description

When running an app built with v2.0.0-beta.42 either as a binary or via wails dev, when the window opens the following is printed on the console:

(wailsv2b42:482510): Gdk-CRITICAL **: 22:17:45.455: gdk_window_get_origin: assertion 'GDK_IS_WINDOW (window)' failed
SetMinMaxSize - min: (0,0) max: (1920,1080)

(wailsv2b42:482510): Gdk-CRITICAL **: 22:17:45.455: gdk_window_get_origin: assertion 'GDK_IS_WINDOW (window)' failed
SetMinMaxSize - min: (0,0) max: (1920,1080)
SetSize:  1024 768
Center: 489x24

Please note that these are not "critical" errors that break anything, just assertions, and there is no need to push out a new release or anything for this. :smile:

There's some accompanying debug output that should probably go away at some point too.

To Reproduce

  1. Update to wails v2.0.0-beta.42
  2. wails init -t svelte -n wailsv2b42
  3. cd wailsv2b42
  4. wails build
  5. build/bin/wailsv2b42

Expected behaviour

Did not expect to see the critical errors (assertions) or debug info.

Screenshots

No response

Attempted Fixes

No response

System Details

Wails CLI v2.0.0-beta.42

Scanning system - Please wait (this may take a long time)...Done.

System
------
OS:             NixOS
Version:        22.11
ID:             nixos
Go Version:     go1.18.4
Platform:       linux
Architecture:   amd64

Wails
------
Version:                v2.0.0-beta.42
Package Manager:        nixpkgs

Dependency      Package Name    Status          Version
----------      ------------    ------          -------
*docker         nixos.docker    Installed       20.10.17
gcc             nixos.gcc       Installed       11.3.0
libgtk-3        nixos.gtk3      Installed       3.24.34
libwebkit       nixos.webkitgtk Installed       2.36.4
npm             nixos.nodejs    Installed       16.15.0
*nsis           nixos.nsis      Available       3.06.1
pkg-config      nixos.pkg-configInstalled       0.29.2
*upx            nixos.upx       Installed       3.96

* - Optional Dependency

Diagnosis
---------
Your system is ready for Wails development!
Optional package(s) installation details:
  - nsis: nix-env -iA nixos.nsis



If Wails is useful to you or your company, please consider sponsoring the project:
https://github.com/sponsors/leaanthony

Additional context

No response

ianmjones avatar Jul 25 '22 21:07 ianmjones

Thanks @ianmjones. Do you know what exactly issues these warnings?

leaanthony avatar Jul 25 '22 21:07 leaanthony

Thanks @ianmjones. Do you know what exactly issues these warnings?

No, not yet, but I'll hopefully have some time later this week to try and debug it.

ianmjones avatar Jul 25 '22 22:07 ianmjones

It's because it doesn't like having its size set before being "realized". https://stackoverflow.com/questions/54144406/stack7229-gdk-critical-110922-221-gdk-window-get-origin-assertion-g

leaanthony avatar Jul 25 '22 22:07 leaanthony

Hi, I just ran into this, window fullscreen and back crashes on linux.

(app-name:10552): Gdk-CRITICAL **: 13:53:47.024: gdk_window_get_origin: assertion 'GDK_IS_WINDOW (window)' failed SetMinMaxSize - min: (1024,768) max: (1920,1080) SetSize: 1024 768 Center: 448x156 Fullscreen scale: 1 SetMinMaxSize - min: (0,0) max: (1920,1080)

Then program exits.

Edit: sorry didn't see the PR, I'll try that later.

lyimmi avatar Jul 26 '22 11:07 lyimmi

I tried the PR and the issue still present. I don't know if @ianmjones's issue and this is connected. If I roll back wails to v2.0.0-beta.39.2, it works just fine, so something happened after that release.

(@leaanthony if this doesn't belong here and you want me to open a new issue please say so!)

I'm using the JS WindowFullscreen() | WindowUnfullscreen() function to toggle fullscreen. It can be reproduced in a clean Wails project as well.

JS code:

    import {WindowFullscreen, WindowUnfullscreen} from '../wailsjs/runtime/runtime'
    
    let fs = false;
    try {
        if (fs) {
            fs = false;
            WindowUnfullscreen();
        } else {
            fs = true;
            WindowFullscreen()
        }
    } catch (err) {
        console.error(err);
    }

If I fullscreen the program 2-3 times it exits with different errors:

[xcb] Unknown sequence number while processing queue
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
{app-name}-dev-linux-amd64: ../../src/xcb_io.c:278: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.

or

SIGABRT: abort
PC=0x7f35da97ba7c m=0 sigcode=18446744073709551610
signal arrived during cgo execution

or without anything written to the terminal, just simply exits.

EDIT: it happens on linux/amd64 and linux/arm too.

lyimmi avatar Jul 27 '22 08:07 lyimmi

It may well be related. The check for screen boundaries gives an error if the window has not been shown yet so there's a good chance fullscreen might fail in that scenario. Let's track it in the same issue.

The other warning ticket might be done though.

leaanthony avatar Jul 27 '22 08:07 leaanthony

Yes, sorry, I didn't see the warnings anymore.

lyimmi avatar Jul 27 '22 08:07 lyimmi

@Lyimmi I'm thinking that if you are seeing the crash in the latest release but not earlier then it's a new ticket. Perhaps git bisect can help us here?

leaanthony avatar Jul 27 '22 09:07 leaanthony

@leaanthony ok, I'll gather what I can and open a new ticket when I have time.

lyimmi avatar Jul 27 '22 14:07 lyimmi