mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 14:45:49 +01:00
fixed Linux maximum width/height on window maximize
This commit is contained in:
parent
6f8344bddc
commit
3f7ba8b264
1 changed files with 18 additions and 1 deletions
|
|
@ -298,7 +298,21 @@ struct webview_priv
|
|||
JSStringRelease(js);
|
||||
g_free(s);
|
||||
}
|
||||
|
||||
|
||||
static void webview_size_allocate_cb(GtkWindow *window,
|
||||
GdkRectangle *allocation, gpointer arg)
|
||||
{
|
||||
struct webview *w = (struct webview *)arg;
|
||||
if (allocation->width > w->priv.max_width || allocation->height > w->priv.max_height) {
|
||||
if (gtk_window_is_maximized(window)) {
|
||||
gint x,y;
|
||||
gtk_window_get_position(window,&x,&y);
|
||||
gtk_window_unmaximize(window);
|
||||
gtk_window_move(window, x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void webview_load_changed_cb(WebKitWebView *webview,
|
||||
WebKitLoadEvent event, gpointer arg)
|
||||
{
|
||||
|
|
@ -349,6 +363,9 @@ struct webview_priv
|
|||
w->priv.max_height = -1;
|
||||
|
||||
gtk_window_set_title(GTK_WINDOW(w->priv.window), w->title);
|
||||
|
||||
g_signal_connect(G_OBJECT(w->priv.window), "size-allocate",
|
||||
G_CALLBACK(webview_size_allocate_cb), w);
|
||||
|
||||
if (w->resizable)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue