Remove display and geometry command line options
authorHugo Villeneuve <hugo@hugovil.com>
Sat, 20 Jul 2013 15:23:40 +0000 (11:23 -0400)
committerHugo Villeneuve <hugo@hugovil.com>
Wed, 6 Nov 2013 00:54:29 +0000 (19:54 -0500)
These options are never used for a dockapp as WindowMaker
position our dockapp automatically in the dock area.

As for the display option, the same can be achieved using
the DISPLAY environment variable.

doc/wmnotify.man
src/dockapp.c
src/dockapp.h
src/options.c
src/wmnotify.c
src/wmnotify.h

index a4a20b6..3971d2d 100644 (file)
@@ -44,17 +44,6 @@ correct permissions (normally 0400) to protect your email account informations.
 \fB\-d\fR
 Display debugging messages.
 
-.TP
-.BI \-display " host" : display
-Specifies the host and screen to be used by \fBwmnotify\fR. By default this
-is obtained from the environment variable
-.SB DISPLAY.
-
-.TP
-.BI \-geometry " geometry"
-.RB ( *geometry )
-Specifies the initial geometry of the window.
-
 .TP
 \fB\-h\fR
 display usage and exit
index b50a373..6156c33 100644 (file)
@@ -156,8 +156,7 @@ copyXPMArea(int x, int y, unsigned int sx, unsigned int sy, int dx, int dy)
  * New window creation and initialization for a Dockable Application
  ******************************************************************************/
 void
-InitDockAppWindow(int argc, char *argv[], char *pixmap_data[],
-                 char *display_arg, char *geometry_arg)
+InitDockAppWindow(int argc, char *argv[], char *pixmap_data[])
 {
        XGCValues gcv;
        XSizeHints size_hints;
@@ -169,10 +168,9 @@ InitDockAppWindow(int argc, char *argv[], char *pixmap_data[],
                          */
 
        /* Opening a connection to the X server. */
-       dockapp.display = XOpenDisplay(display_arg);
+       dockapp.display = XOpenDisplay(NULL);
        if (dockapp.display == NULL) {
-               fprintf(stderr, "%s: Can't open display: %s\n", PACKAGE,
-                       XDisplayName(display_arg));
+               fprintf(stderr, "%s: Can't open X display\n", PACKAGE);
                ErrorLocation(__FILE__, __LINE__);
                exit(EXIT_FAILURE);
        }
@@ -191,7 +189,7 @@ InitDockAppWindow(int argc, char *argv[], char *pixmap_data[],
         * XWMGeometry() returns an 'int', but Xlib documentation doesn't
         * explain it's meaning.
         */
-       XWMGeometry(dockapp.display, dockapp.screen, geometry_arg, NULL,
+       XWMGeometry(dockapp.display, dockapp.screen, NULL, NULL,
                    BWIDTH, &size_hints, &size_hints.x, &size_hints.y,
                    &size_hints.width, &size_hints.height, &gravity);
 
index 07573de..689bafc 100644 (file)
@@ -43,8 +43,7 @@ struct dockapp_t {
 };
 
 void
-InitDockAppWindow(int argc, char *argv[], char *pixmap_data[],
-                 char *display_arg, char *geometry_arg);
+InitDockAppWindow(int argc, char *argv[], char *pixmap_data[]);
 
 void RedrawWindow(void);
 
index 1c398e8..35e1b75 100644 (file)
@@ -48,10 +48,6 @@ static void DisplayUsage(void)
        printf("use alternate configuration file\n");
        printf("  -d                        ");
        printf("Display debugging messages.\n");
-       printf("  -display <host:display>   ");
-       printf("X display name\n");
-       printf("  -geometry +XPOS+YPOS      ");
-       printf("initial window position\n");
        printf("  -h                        ");
        printf("display this help and exit\n");
        printf("  -version                  ");
@@ -93,8 +89,6 @@ void ParseCommandLineOptions(int argc, char *argv[])
        int i;
        char *token;
        bool config_file_on = false;
-       bool display_on = false;
-       bool geometry_on = false;
 
        /* Default values. */
        wmnotify_infos.debug = false;
@@ -114,16 +108,7 @@ void ParseCommandLineOptions(int argc, char *argv[])
                                }
                                break;
                        case 'd':
-                               if (STREQ("display", &token[1]))
-                                       display_on = true;
-                               else if (strlen(&token[1]) == 1)
-                                       wmnotify_infos.debug = true;
-                               break;
-                       case 'g':
-                               if (STREQ("geometry", &token[1]))
-                                       geometry_on = true;
-                               else
-                                       InvalidOption("invalid option", token);
+                               wmnotify_infos.debug = true;
                                break;
                        case 'h':
                                if (strlen(&token[1]) == 1) {
@@ -152,12 +137,6 @@ void ParseCommandLineOptions(int argc, char *argv[])
                                    token;
                                /*strcpy( config_file_name, token ); */
                                config_file_on = false;
-                       } else if (display_on != false) {
-                               display_on = false;
-                               wmnotify_infos.display_arg = token;
-                       } else if (geometry_on != false) {
-                               geometry_on = false;
-                               wmnotify_infos.geometry_arg = token;
                        } else {
                                InvalidOption("invalid option", token);
                        }
@@ -166,11 +145,6 @@ void ParseCommandLineOptions(int argc, char *argv[])
        }                       /* end for */
 
        if (config_file_on != false) {
-               InvalidOption("missing configuration file parameter",
-                             NULL);
-       } else if (display_on != false) {
-               InvalidOption("missing display parameter", NULL);
-       } else if (geometry_on != false) {
-               InvalidOption("missing geometry parameter", NULL);
+               InvalidOption("missing configuration file parameter", NULL);
        }
 }
index 8847a24..7f444a2 100644 (file)
@@ -479,9 +479,7 @@ int main(int argc, char *argv[])
        ProcessXlibEventsInit(SingleClick, DoubleClick);
 
        /* Initializing and creating a DockApp window. */
-       InitDockAppWindow(argc, argv, wmnotify_xpm,
-                         wmnotify_infos.display_arg,
-                         wmnotify_infos.geometry_arg);
+       InitDockAppWindow(argc, argv, wmnotify_xpm);
 
        /* Starting thread for periodically checking for new mail. */
        status = pthread_create(&timer_thread, NULL, TimerThread, NULL);
index 6c5e88d..4f3add3 100644 (file)
@@ -71,8 +71,6 @@
 
 struct wmnotify_t {
        bool debug;
-       char *display_arg;
-       char *geometry_arg;
        char *optional_config_file;
        char mail_client_command[512];
        char *mail_client_argv[ARGV_LIMIT];