|
|
@ -31,17 +31,22 @@
|
|
|
|
#include <X11/extensions/Xrandr.h>
|
|
|
|
#include <X11/extensions/Xrandr.h>
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
static int
|
|
|
|
process_randr(Display *disp, Window win, int event_base, XEvent *ev)
|
|
|
|
process_randr(Display *disp, Screen *screen, int screenNumber, Window win,
|
|
|
|
|
|
|
|
int event_base, XEvent *ev)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
XRRScreenChangeNotifyEvent *rr_screen_change_notify;
|
|
|
|
XRRScreenChangeNotifyEvent *rr_screen_change_notify;
|
|
|
|
|
|
|
|
|
|
|
|
switch (ev->type - event_base)
|
|
|
|
switch (ev->type - event_base)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case RRScreenChangeNotify:
|
|
|
|
case RRScreenChangeNotify:
|
|
|
|
|
|
|
|
XRRUpdateConfiguration(ev);
|
|
|
|
rr_screen_change_notify = (XRRScreenChangeNotifyEvent *) ev;
|
|
|
|
rr_screen_change_notify = (XRRScreenChangeNotifyEvent *) ev;
|
|
|
|
printf("RRScreenChangeNotify: width %d height %d\n",
|
|
|
|
printf("RRScreenChangeNotify: width %d height %d\n",
|
|
|
|
rr_screen_change_notify->width,
|
|
|
|
rr_screen_change_notify->width,
|
|
|
|
rr_screen_change_notify->height);
|
|
|
|
rr_screen_change_notify->height);
|
|
|
|
|
|
|
|
printf("DisplayWidth %d DisplayHeight %d\n",
|
|
|
|
|
|
|
|
DisplayWidth(disp, screenNumber),
|
|
|
|
|
|
|
|
DisplayHeight(disp, screenNumber));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
@ -128,7 +133,8 @@ main(int argc, char **argv)
|
|
|
|
(ev.type < rr_event_base + RRNumberEvents))
|
|
|
|
(ev.type < rr_event_base + RRNumberEvents))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
printf("randr\n");
|
|
|
|
printf("randr\n");
|
|
|
|
process_randr(disp, win, rr_event_base, &ev);
|
|
|
|
process_randr(disp, screen, screenNumber, win,
|
|
|
|
|
|
|
|
rr_event_base, &ev);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|