]> granicus.if.org Git - handbrake/commitdiff
LinGui: fix window size queries on wayland
authorJohn Stebbins <jstebbins.hb@gmail.com>
Sat, 23 Dec 2017 19:39:31 +0000 (11:39 -0800)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Sat, 23 Dec 2017 19:39:31 +0000 (11:39 -0800)
gtk/src/callbacks.c

index 8bd7443de252c0cc9c8edde66f6e15748f07432a..9c5a2e893812744304b6c35710ddf4065185fc0f 100644 (file)
@@ -5814,14 +5814,15 @@ presets_window_configure_cb(
 {
     if (gtk_widget_get_visible(widget))
     {
-        gint w, h;
+        gint w, h, ww, wh;
         w = ghb_dict_get_int(ud->prefs, "presets_window_width");
         h = ghb_dict_get_int(ud->prefs, "presets_window_height");
 
-        if ( w != event->width || h != event->height )
+        gtk_window_get_size(GTK_WINDOW(widget), &ww, &wh);
+        if ( w != ww || h != wh )
         {
-            ghb_dict_set_int(ud->prefs, "presets_window_width", event->width);
-            ghb_dict_set_int(ud->prefs, "presets_window_height", event->height);
+            ghb_dict_set_int(ud->prefs, "presets_window_width", ww);
+            ghb_dict_set_int(ud->prefs, "presets_window_height", wh);
             ghb_pref_set(ud->prefs, "presets_window_width");
             ghb_pref_set(ud->prefs, "presets_window_height");
             ghb_prefs_store();
@@ -5838,14 +5839,15 @@ window_configure_cb(
 {
     if (gtk_widget_get_visible(widget))
     {
-        gint w, h;
+        gint w, h, ww, wh;
         w = ghb_dict_get_int(ud->prefs, "window_width");
         h = ghb_dict_get_int(ud->prefs, "window_height");
 
-        if ( w != event->width || h != event->height )
+        gtk_window_get_size(GTK_WINDOW(widget), &ww, &wh);
+        if ( w != ww || h != wh )
         {
-            ghb_dict_set_int(ud->prefs, "window_width", event->width);
-            ghb_dict_set_int(ud->prefs, "window_height", event->height);
+            ghb_dict_set_int(ud->prefs, "window_width", ww);
+            ghb_dict_set_int(ud->prefs, "window_height", wh);
             ghb_pref_set(ud->prefs, "window_width");
             ghb_pref_set(ud->prefs, "window_height");
             ghb_prefs_store();