From 109eff420c0567657a20150e94e2f4db32da7633 Mon Sep 17 00:00:00 2001
From: Daiki Ueno <ueno@unixuser.org>
Date: Fri, 12 Aug 2011 16:40:45 +0900
Subject: [PATCH] Check "start-fullscreen" GSettings key.

---
 data/org.fedorahosted.eekboard.gschema.xml.in | 5 +++++
 src/client-main.c                             | 6 ++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/data/org.fedorahosted.eekboard.gschema.xml.in b/data/org.fedorahosted.eekboard.gschema.xml.in
index 36ac2017..08438a70 100644
--- a/data/org.fedorahosted.eekboard.gschema.xml.in
+++ b/data/org.fedorahosted.eekboard.gschema.xml.in
@@ -16,5 +16,10 @@
       <summary>Hide keyboard automatically when focus is out</summary>
       <description>If true, hide keyboard automatically when focus is out.</description>
     </key>
+    <key name="start-fullscreen" type="b">
+      <default>false</default>
+      <summary>Switch to fullscreen mode when startup</summary>
+      <description>If true, switch to fullscreen mode when startup.</description>
+    </key>
   </schema>
 </schemalist>
diff --git a/src/client-main.c b/src/client-main.c
index 1bca60ad..3f7cbe4d 100644
--- a/src/client-main.c
+++ b/src/client-main.c
@@ -131,6 +131,7 @@ main (int argc, char **argv)
     GOptionContext *option_context;
     GMainLoop *loop;
     gint focus;
+    GSettings *settings;
 
     if (!gtk_init_check (&argc, &argv)) {
         g_printerr ("Can't init GTK\n");
@@ -186,9 +187,9 @@ main (int argc, char **argv)
         exit (1);
     }
 
+    settings = g_settings_new ("org.fedorahosted.eekboard");
     focus = FOCUS_NONE;
     if (opt_focus) {
-        GSettings *settings = g_settings_new ("org.fedorahosted.eekboard");
         gchar *focus_listener = g_settings_get_string (settings,
                                                        "focus-listener");
         g_object_unref (settings);
@@ -312,7 +313,8 @@ main (int argc, char **argv)
         g_object_unref (context);
     }
 
-    if (opt_fullscreen) {
+    if (opt_fullscreen ||
+        g_settings_get_boolean (settings, "start-fullscreen")) {
         g_object_get (client, "context", &context, NULL);
         eekboard_context_set_fullscreen (context, TRUE, NULL);
         g_object_unref (context);
-- 
GitLab