Skip to content

Commit 7e12f9d

Browse files
authored
fix: offset lost after invoking gtk hide on linux (#241)
1 parent 651c76c commit 7e12f9d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

linux/window_manager_plugin.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,14 @@ static FlMethodResponse* show(WindowManagerPlugin* self) {
126126
}
127127

128128
static FlMethodResponse* hide(WindowManagerPlugin* self) {
129+
gint x, y, width, height;
130+
// store the bound of window before hide
131+
gtk_window_get_position(get_window(self), &x, &y);
132+
gtk_window_get_size(get_window(self), &width, &height);
129133
gtk_widget_hide(GTK_WIDGET(get_window(self)));
134+
// restore the bound of window after hide
135+
gtk_window_move(get_window(self), x, y);
136+
gtk_window_resize(get_window(self), width, height);
130137
g_autoptr(FlValue) result = fl_value_new_bool(true);
131138
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
132139
}

0 commit comments

Comments
 (0)