From: Gabriel Valcazar <gabriel.valcazar@digi.com>
Date: Wed, 23 Jun 2021 10:17:59 +0200
Subject: [PATCH 2/2] cog-platform-fdo: always use fullscreen mode

Otherwise, the browser will spawn on a random place on the desktop every time.

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
---
 platform/fdo/cog-platform-fdo.c | 50 ++++++++++-----------------------
 1 file changed, 15 insertions(+), 35 deletions(-)

diff --git a/platform/fdo/cog-platform-fdo.c b/platform/fdo/cog-platform-fdo.c
index c7e1eea..4f6c0c7 100644
--- a/platform/fdo/cog-platform-fdo.c
+++ b/platform/fdo/cog-platform-fdo.c
@@ -2134,42 +2134,22 @@ create_window (GError **error)
         configure_surface_geometry (0, 0);
     }
 
-    const char* env_var;
-    if ((env_var = g_getenv ("COG_PLATFORM_FDO_VIEW_FULLSCREEN")) &&
-        g_ascii_strtoll (env_var, NULL, 10) > 0)
-    {
-        win_data.is_maximized = false;
-        win_data.is_fullscreen = true;
-
-        if (wl_data.xdg_shell != NULL) {
-            xdg_toplevel_set_fullscreen (win_data.xdg_toplevel, NULL);
-        } else if (wl_data.fshell != NULL) {
-            win_data.should_resize_to_largest_output = true;
-            resize_to_largest_output ();
-        } else if (wl_data.shell != NULL) {
-            wl_shell_surface_set_fullscreen (win_data.shell_surface,
-                                             WL_SHELL_SURFACE_FULLSCREEN_METHOD_SCALE,
-                                             0,
-                                             NULL);
-        } else {
-            g_warning ("No available shell capable of fullscreening.");
-            win_data.is_fullscreen = false;
-        }
-    }
-    else if ((env_var = g_getenv ("COG_PLATFORM_FDO_VIEW_MAXIMIZE")) &&
-             g_ascii_strtoll (env_var, NULL, 10) > 0)
-    {
-        win_data.is_maximized = true;
-        win_data.is_fullscreen = false;
+    win_data.is_maximized = false;
+    win_data.is_fullscreen = true;
 
-        if (wl_data.xdg_shell != NULL) {
-            xdg_toplevel_set_maximized (win_data.xdg_toplevel);
-        } else if (wl_data.shell != NULL) {
-            wl_shell_surface_set_maximized (win_data.shell_surface, NULL);
-        } else {
-            g_warning ("No available shell capable of maximizing.");
-            win_data.is_maximized = false;
-        }
+    if (wl_data.xdg_shell != NULL) {
+        xdg_toplevel_set_fullscreen (win_data.xdg_toplevel, NULL);
+    } else if (wl_data.fshell != NULL) {
+        win_data.should_resize_to_largest_output = true;
+        resize_to_largest_output ();
+    } else if (wl_data.shell != NULL) {
+        wl_shell_surface_set_fullscreen (win_data.shell_surface,
+                                         WL_SHELL_SURFACE_FULLSCREEN_METHOD_SCALE,
+                                         0,
+                                         NULL);
+    } else {
+        g_warning ("No available shell capable of fullscreening.");
+        win_data.is_fullscreen = false;
     }
 
     return TRUE;
