[libhandy] header-bar: Refine mobile window detection



commit ab4d632507b7f0dc027757b81af33601465489a1
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Wed Aug 5 09:02:07 2020 +0200

    header-bar: Refine mobile window detection
    
    This widens the mobile screen width to 480px and don't check the height
    for vertical mobile detection to be a bit more inclusive, and at the
    same time this considers only maximized windows as mobile to avoid
    replacing the close button by a back button to close a floating window
    on the desktop.
    
    Fixes https://gitlab.gnome.org/GNOME/libhandy/-/issues/315

 src/hdy-header-bar.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/hdy-header-bar.c b/src/hdy-header-bar.c
index e737e59d..c07a4021 100644
--- a/src/hdy-header-bar.c
+++ b/src/hdy-header-bar.c
@@ -69,7 +69,7 @@
 #define DEFAULT_SPACING 6
 #define MIN_TITLE_CHARS 5
 
-#define MOBILE_WINDOW_WIDTH  400
+#define MOBILE_WINDOW_WIDTH  480
 #define MOBILE_WINDOW_HEIGHT 800
 
 typedef struct {
@@ -614,7 +614,7 @@ compute_is_mobile_window (GtkWindow *window)
   gtk_window_get_size (window, &window_width, &window_height);
 
   if (window_width <= MOBILE_WINDOW_WIDTH &&
-      window_height <= MOBILE_WINDOW_HEIGHT)
+      gtk_window_is_maximized (window))
     return TRUE;
 
   /* Mobile landscape mode. */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]