From ee3242c4b065b97df2b8c692a7e2b5eb11c95b7e Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Sat, 20 Jul 2013 11:23:40 -0400 Subject: [PATCH] Remove display and geometry command line options 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 | 11 ----------- src/dockapp.c | 10 ++++------ src/dockapp.h | 3 +-- src/options.c | 30 ++---------------------------- src/wmnotify.c | 4 +--- src/wmnotify.h | 2 -- 6 files changed, 8 insertions(+), 52 deletions(-) diff --git a/doc/wmnotify.man b/doc/wmnotify.man index a4a20b6..3971d2d 100644 --- a/doc/wmnotify.man +++ b/doc/wmnotify.man @@ -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 diff --git a/src/dockapp.c b/src/dockapp.c index b50a373..6156c33 100644 --- a/src/dockapp.c +++ b/src/dockapp.c @@ -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); diff --git a/src/dockapp.h b/src/dockapp.h index 07573de..689bafc 100644 --- a/src/dockapp.h +++ b/src/dockapp.h @@ -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); diff --git a/src/options.c b/src/options.c index 1c398e8..35e1b75 100644 --- a/src/options.c +++ b/src/options.c @@ -48,10 +48,6 @@ static void DisplayUsage(void) printf("use alternate configuration file\n"); printf(" -d "); printf("Display debugging messages.\n"); - printf(" -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); } } diff --git a/src/wmnotify.c b/src/wmnotify.c index 8847a24..7f444a2 100644 --- a/src/wmnotify.c +++ b/src/wmnotify.c @@ -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); diff --git a/src/wmnotify.h b/src/wmnotify.h index 6c5e88d..4f3add3 100644 --- a/src/wmnotify.h +++ b/src/wmnotify.h @@ -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]; -- 2.20.1