[gtk+] Drop the --screen cmdline argument



commit 5eb4506b944879c37ea3521cb082a383ab26039a
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Dec 14 22:32:47 2010 -0500

    Drop the --screen cmdline argument
    
    Commandline arguments should go away altogether, but this one
    goes first, since we then don't need to worry about
    _gdk_windowing_substitute_screen_number anymore.

 docs/reference/gtk/x11.sgml |   22 ++--------------------
 gdk/gdk.c                   |   18 +-----------------
 gdk/gdkglobals.c            |    1 -
 gdk/x11/gdkscreen-x11.c     |   31 +++++--------------------------
 4 files changed, 8 insertions(+), 64 deletions(-)
---
diff --git a/docs/reference/gtk/x11.sgml b/docs/reference/gtk/x11.sgml
index dab177c..30600da 100644
--- a/docs/reference/gtk/x11.sgml
+++ b/docs/reference/gtk/x11.sgml
@@ -44,25 +44,7 @@ arguments.
 
 <para>
 The name of the X display to open instead of the one specified
-in the <envar>DISPLAY</envar> environment variable. 
-</para>
-</formalpara>
-
-<formalpara>
-<title><systemitem>--screen <replaceable>screen_number</replaceable></systemitem></title>
-
-<para>
-  The number of the screen within the default display. This overrides
-  any screen number specified in the display name specified by
-  by he <systemitem>--display</systemitem> command line option or
-  the <envar>DISPLAY</envar> environment variable. If this screen
-  cannot be opened, then GTK+ will fall back to the screen
-  specified in the display name. This option is not useful
-  interactively; the intended purposes is that when a program
-  registers its command line with a <firstterm>session
-  manager</firstterm> for later restarting, it can save the
-  screen it is on, without having to worry if it might be
-  restarted on a different display.
+in the <envar>DISPLAY</envar> environment variable.
 </para>
 </formalpara>
 
@@ -70,7 +52,7 @@ in the <envar>DISPLAY</envar> environment variable.
 <title><systemitem>--sync</systemitem></title>
 
 <para>
-Makes all X requests synchronously. This is a useful option for 
+Makes all X requests synchronously. This is a useful option for
 debugging, but it will slow down the performance considerably.
 </para>
 </formalpara>
diff --git a/gdk/gdk.c b/gdk/gdk.c
index ba8f7f7..5ca6326 100644
--- a/gdk/gdk.c
+++ b/gdk/gdk.c
@@ -168,9 +168,6 @@ static const GOptionEntry gdk_args[] = {
   { "display",      0, G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_STRING,   &_gdk_display_name,
     /* Description of --display=DISPLAY in --help output */    N_("X display to use"),
     /* Placeholder in --display=DISPLAY in --help output */    N_("DISPLAY") },
-  { "screen",       0, 0, G_OPTION_ARG_INT,      &_gdk_screen_number,
-    /* Description of --screen=SCREEN in --help output */      N_("X screen to use"),
-    /* Placeholder in --screen=SCREEN in --help output */      N_("SCREEN") },
 #ifdef G_ENABLE_DEBUG
   { "gdk-debug",    0, 0, G_OPTION_ARG_CALLBACK, gdk_arg_debug_cb,  
     /* Description of --gdk-debug=FLAGS in --help output */    N_("GDK debugging flags to set"),
@@ -296,12 +293,7 @@ G_CONST_RETURN gchar *
 gdk_get_display_arg_name (void)
 {
   if (!_gdk_display_arg_name)
-    {
-      if (_gdk_screen_number >= 0)
-	_gdk_display_arg_name = _gdk_windowing_substitute_screen_number (_gdk_display_name, _gdk_screen_number);
-      else
-	_gdk_display_arg_name = g_strdup (_gdk_display_name);
-   }
+    _gdk_display_arg_name = g_strdup (_gdk_display_name);
 
    return _gdk_display_arg_name;
 }
@@ -331,14 +323,6 @@ gdk_display_open_default_libgtk_only (void)
 
   display = gdk_display_open (gdk_get_display_arg_name ());
 
-  if (!display && _gdk_screen_number >= 0)
-    {
-      g_free (_gdk_display_arg_name);
-      _gdk_display_arg_name = g_strdup (_gdk_display_name);
-
-      display = gdk_display_open (_gdk_display_name);
-    }
-
   return display;
 }
 
diff --git a/gdk/gdkglobals.c b/gdk/gdkglobals.c
index 5af484b..085568f 100644
--- a/gdk/gdkglobals.c
+++ b/gdk/gdkglobals.c
@@ -35,7 +35,6 @@
 guint               _gdk_debug_flags = 0;
 GList              *_gdk_default_filters = NULL;
 gchar              *_gdk_display_name = NULL;
-gint                _gdk_screen_number = -1;
 gchar              *_gdk_display_arg_name = NULL;
 gboolean            _gdk_native_windows = FALSE;
 gboolean            _gdk_disable_multidevice = FALSE;
diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c
index 8899170..95cfecb 100644
--- a/gdk/x11/gdkscreen-x11.c
+++ b/gdk/x11/gdkscreen-x11.c
@@ -959,34 +959,13 @@ _gdk_x11_screen_process_owner_change (GdkScreen *screen,
 #endif
 }
 
-/**
- * _gdk_windowing_substitute_screen_number:
- * @display_name: The name of a display, in the form used by 
- *                gdk_display_open (). If %NULL a default value
- *                will be used. On X11, this is derived from the DISPLAY
- *                environment variable.
- * @screen_number: The number of a screen within the display
- *                 referred to by @display_name.
- *
- * Modifies a @display_name to make @screen_number the default
- * screen when the display is opened.
- *
- * Return value: a newly allocated string holding the resulting
- *   display name. Free with g_free().
- */
-gchar * 
-_gdk_windowing_substitute_screen_number (const gchar *display_name,
-					 gint         screen_number)
+static gchar *
+substitute_screen_number (const gchar *display_name,
+                          gint         screen_number)
 {
   GString *str;
   gchar   *p;
 
-  if (!display_name)
-    display_name = getenv ("DISPLAY");
-
-  if (!display_name)
-    return NULL;
-
   str = g_string_new (display_name);
 
   p = strrchr (str->str, '.');
@@ -1007,8 +986,8 @@ gdk_screen_x11_make_display_name (GdkScreen *screen)
 
   old_display = gdk_display_get_name (gdk_screen_get_display (screen));
 
-  return _gdk_windowing_substitute_screen_number (old_display, 
-						  gdk_screen_get_number (screen));
+  return substitute_screen_number (old_display,
+                                   gdk_screen_get_number (screen));
 }
 
 static GdkWindow *



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