Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle xdisplay null #53

Merged
merged 2 commits into from
Feb 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions CNFGXDriver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}

Expand Down Expand Up @@ -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 );

Expand Down
6 changes: 0 additions & 6 deletions cnping.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ uint64_t globalrx;
uint64_t globallost;
uint8_t pattern[8];

int runargc;
char ** runargv;

#define PINGCYCLEWIDTH 8192
#define TIMEOUT 4

Expand Down Expand Up @@ -636,9 +633,6 @@ int main( int argc, const char ** argv )
}
#endif

runargc = argc;
runargv = argv;

pingperiodseconds = 0.02;
ExtraPingSize = 0;
title[0] = 0;
Expand Down