Browse Source

Take the default screen if more than one are available

master
Aitor 2 months ago
parent
commit
3070e0e341
1 changed files with 7 additions and 4 deletions
  1. +7
    -4
      hopman-1.0/main.cpp

+ 7
- 4
hopman-1.0/main.cpp View File

@@ -48,11 +48,14 @@ void get_xdpy_dim(int *x, int *y)
throw std::runtime_error("Sorry, cannot connect to X server!\n");
};

// return the number of available screens
int count_screens = ScreenCount(display);
// return the number of available screens (unused here)
//int count_screens = ScreenCount(display);

// Take the first one as reference
screen = ScreenOfDisplay(display, 0);
//screen = ScreenOfDisplay(display, 0);
// Take de default screen
screen = DefaultScreenOfDisplay(display);
*x = screen->width;
*y = screen->height;

@@ -135,7 +138,7 @@ Finish:
// Get the dimensions of the screen
int x, y;
get_xdpy_dim(&x, &y);
get_xdpy_dim(&x, &y);
auto annex = std::make_unique<Hopman::Annex>(argc, argv, x, y);
#if GTK_MAJOR_VERSION == 2


Loading…
Cancel
Save