/* * Display screen configuration * * Compile with : * cc test_display.c -o test_display `pkg-config --cflags --libs gtk+-2.0` * */ #include #include int main (int argc, char **argv) { gint i, nscreens; GdkDisplay *gdisplay; GdkScreen *gscreen; gtk_init (&argc, &argv); gdisplay = gdk_display_get_default (); nscreens = gdk_display_get_n_screens(gdisplay); g_print ("Current display has %i screen(s) :\n", nscreens); for(i = 0; i < nscreens; i++) { GdkRectangle rect; gscreen = gdk_display_get_screen(gdisplay, i); gdk_screen_get_monitor_geometry (gscreen, i, &rect); g_print (" - Screen %i, position (%i, %i), size (%i, %i)\n", i, rect.x, rect.y, rect.width, rect.height); } return 0; }