mirror of
https://github.com/vale981/spectrwm
synced 2025-03-06 02:01:42 -05:00
replace xrandr setup with XCB
This commit is contained in:
parent
bef91830c7
commit
7b36e544be
1 changed files with 10 additions and 13 deletions
23
spectrwm.c
23
spectrwm.c
|
@ -7425,10 +7425,9 @@ void
|
||||||
setup_screens(void)
|
setup_screens(void)
|
||||||
{
|
{
|
||||||
int i, j, k, num_screens;
|
int i, j, k, num_screens;
|
||||||
int errorbase;
|
|
||||||
struct workspace *ws;
|
struct workspace *ws;
|
||||||
XGCValues gcv;
|
XGCValues gcv;
|
||||||
|
const xcb_query_extension_reply_t *qep;
|
||||||
xcb_randr_query_version_cookie_t c;
|
xcb_randr_query_version_cookie_t c;
|
||||||
xcb_randr_query_version_reply_t *r;
|
xcb_randr_query_version_reply_t *r;
|
||||||
|
|
||||||
|
@ -7439,18 +7438,16 @@ setup_screens(void)
|
||||||
"screens");
|
"screens");
|
||||||
|
|
||||||
/* initial Xrandr setup */
|
/* initial Xrandr setup */
|
||||||
xrandr_support = XRRQueryExtension(display,
|
xrandr_support = False;
|
||||||
&xrandr_eventbase, &errorbase);
|
c = xcb_randr_query_version(conn, True, True);
|
||||||
if (xrandr_support) {
|
r = xcb_randr_query_version_reply(conn, c, NULL);
|
||||||
c = xcb_randr_query_version(conn, True, False);
|
if (r) {
|
||||||
r = xcb_randr_query_version_reply(conn, c, NULL);
|
if (r->major_version >= 1)
|
||||||
if (r) {
|
xrandr_support = True;
|
||||||
if (r->major_version < 1)
|
free(r);
|
||||||
xrandr_support = 0;
|
|
||||||
free(r);
|
|
||||||
} else
|
|
||||||
xrandr_support = 0;
|
|
||||||
}
|
}
|
||||||
|
qep = xcb_get_extension_data(conn, &xcb_randr_id);
|
||||||
|
xrandr_eventbase = qep->first_event;
|
||||||
|
|
||||||
/* map physical screens */
|
/* map physical screens */
|
||||||
for (i = 0; i < num_screens; i++) {
|
for (i = 0; i < num_screens; i++) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue