mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
[linux] Move SetPosition, Center, Fullscreen and UnFullscreen to main thread
This commit is contained in:
@@ -426,6 +426,28 @@ void SetTitle(GtkWindow* window, char* title) {
|
||||
ExecuteOnMainThread(setTitle, (gpointer)args);
|
||||
}
|
||||
|
||||
typedef struct SetPositionArgs {
|
||||
int x;
|
||||
int y;
|
||||
void* window;
|
||||
} SetPositionArgs;
|
||||
|
||||
void setPosition(gpointer data) {
|
||||
SetPositionArgs* args = (SetPositionArgs*)data;
|
||||
gtk_window_move((GtkWindow*)args->window, args->x, args->y);
|
||||
free(args);
|
||||
}
|
||||
|
||||
void SetPosition(void* window, int x, int y) {
|
||||
GdkRectangle monitorDimensions = getCurrentMonitorGeometry(window);
|
||||
SetPositionArgs* args = malloc(sizeof(SetPositionArgs));
|
||||
args->window = window;
|
||||
args->x = monitorDimensions.x + x;
|
||||
args->y = monitorDimensions.y + y;
|
||||
ExecuteOnMainThread(setPosition, (gpointer)args);
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
import "C"
|
||||
import (
|
||||
|
||||
Reference in New Issue
Block a user