commit 75e312a9ec2a1de09b505332d27cf052c10abf4f
parent 62d9591e5326dcb3e2b2b6fb90d0ebbc1d25ace3
Author: cnlohr <lohr85@gmail.com>
Date: Mon, 23 Sep 2019 01:01:54 -0400
Merge branch 'master' into attempt_without_admin
Diffstat:
2 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/CNFGXDriver.c b/CNFGXDriver.c
@@ -91,9 +91,8 @@ void CNFGSetupFullscreen( const char * WindowName, int screen_no )
int screen = XDefaultScreen(CNFGDisplay);
int xpos, ypos;
- if (!XShapeQueryExtension(CNFGDisplay, &event_basep, &error_basep))
- {
- fprintf( stderr, "X-Server does not support shape extension" );
+ if (!XShapeQueryExtension(CNFGDisplay, &event_basep, &error_basep)) {
+ fprintf( stderr, "X-Server does not support shape extension\n" );
exit( 1 );
}
@@ -164,6 +163,11 @@ void CNFGTearDown()
void CNFGSetup( const char * WindowName, int w, int h )
{
CNFGDisplay = XOpenDisplay(NULL);
+ if ( !CNFGDisplay ) {
+ fprintf( stderr, "Could not get an X Display.\n%s",
+ "Are you in text mode or using SSH without X11-Forwarding?\n" );
+ exit( 1 );
+ }
atexit( CNFGTearDown );
XGetWindowAttributes( CNFGDisplay, RootWindow(CNFGDisplay, 0), &CNFGWinAtt );
diff --git a/cnping.c b/cnping.c
@@ -36,9 +36,6 @@ uint64_t globalrx;
uint64_t globallost;
uint8_t pattern[8];
-int runargc;
-const char ** runargv;
-
#define PINGCYCLEWIDTH 8192
#define TIMEOUT 4
@@ -639,9 +636,6 @@ int main( int argc, const char ** argv )
}
#endif
- runargc = argc;
- runargv = argv;
-
pingperiodseconds = 0.02;
ExtraPingSize = 0;
title[0] = 0;