wails icon indicating copy to clipboard operation
wails copied to clipboard

crash when invoke runtime function on ubuntu 20.04

Open zhangpy opened this issue 3 years ago • 6 comments

Description

add method

func (a *App) SavePosition() {
	w, h := runtime.WindowGetSize(a.ctx)
	x, y := runtime.WindowGetPosition(a.ctx)
	fmt.Printf("%#v %#v\n", w, h)
	fmt.Printf("%#v %#v\n", x, y)
}

and invoke in demo greet method.

[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.
wt-dev-linux-amd64: ../../src/xcb_io.c:260: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.
SIGABRT: abort

To Reproduce

w.zip

Expected behaviour

what is correct way or time to save window position if user change position.

Screenshots

No response

Attempted Fixes

No response

System Details

Wails CLI v2.0.0-beta.37


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

System
------
OS:		Ubuntu
Version: 	20.04
ID:		ubuntu
Go Version:	go1.18.3
Platform:	linux
Architecture:	amd64

Wails
------
Version: 		v2.0.0-beta.37
Package Manager: 	apt

Dependency	Package Name		Status		Version
----------	------------		------		-------
*docker	docker.io		        Installed	20.10.17
gcc		build-essential		Installed	12.8ubuntu1.1
libgtk-3	libgtk-3-dev		Installed	3.24.20-0ubuntu1.1
libwebkit	libwebkit2gtk-4.0-dev	Installed	2.36.3-0ubuntu0.20.04.1
npm		npm			Installed	8.12.1
*nsis		nsis			Available	3.05-2
pkg-config	pkg-config		Installed	0.29.1-0ubuntu4

* - Optional Dependency

Diagnosis
---------
Your system is ready for Wails development!
Optional package(s) installation details: 
  - nsis: sudo apt install nsis

Additional context

No response

zhangpy avatar Jun 08 '22 13:06 zhangpy

another linux issue, runtime.WindowSetPosition can't change position on my ubuntu. (but works on windows)

func (a *App) startup(ctx context.Context) {
	a.ctx = ctx
	runtime.WindowSetPosition(ctx, 100, 100)
}

zhangpy avatar Jun 08 '22 13:06 zhangpy

Thanks for raising this. Please split into 2 issues.

The first issue, what did google give you? Did you read this? https://github.com/Ulauncher/Ulauncher/issues/667

leaanthony avatar Jun 08 '22 22:06 leaanthony

you could take a look at the zip file to reproduce it. The project is created by wails command and I modified a little. https://github.com/wailsapp/wails/files/8862072/w.zip

zhangpy avatar Jun 12 '22 10:06 zhangpy

Hi @zhangpy - Can you please check the linked PR to see if this fixes your issue? Thanks.

leaanthony avatar Jun 18 '22 07:06 leaanthony

@zhangpy - Any updates?

leaanthony avatar Jun 21 '22 10:06 leaanthony

@leaanthony the pr works, I tested on master branch and did not crash anymore.thanks.

zhangpy avatar Jul 01 '22 05:07 zhangpy

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 31 '22 20:07 stale[bot]