Verified Commit b6181a50 authored by Bernd Paysan's avatar Bernd Paysan
Browse files

Solve problem when primary screen is off

parent 1c1485b3
Loading
Loading
Loading
Loading
Loading
+16 −8
Original line number Original line Diff line number Diff line
@@ -90,14 +90,22 @@ XIMPreeditNothing or XIMPreeditNone or Constant XIMPreedit
    dpy #38 0 XKeycodeToKeysym drop
    dpy #38 0 XKeycodeToKeysym drop
    dpy screen XRootWindow to root-win
    dpy screen XRootWindow to root-win
    dpy root-win XRRGetScreenResourcesCurrent to rr-res
    dpy root-win XRRGetScreenResourcesCurrent to rr-res
    dpy rr-res dup XRRScreenResources-crtcs @ @ XRRGetCrtcInfo to rr-crt0
    rr-res XRRScreenResources-noutput l@ 0 DO
	dpy rr-res dup XRRScreenResources-crtcs @ I cells + @
	XRRGetCrtcInfo to rr-crt0
	rr-crt0 XRRCrtcInfo-noutput l@ 0 ?DO
	rr-crt0 XRRCrtcInfo-noutput l@ 0 ?DO
	    dpy rr-res rr-crt0 XRRCrtcInfo-outputs @ I cells + @
	    dpy rr-res rr-crt0 XRRCrtcInfo-outputs @ I cells + @
	    XRRGetOutputInfo
	    XRRGetOutputInfo
	dup XRROutputInfo-npreferred l@ IF  to rr-out0  ELSE  drop  THEN
	    dup XRROutputInfo-npreferred l@
	    over XRROutputInfo-connection w@ 0= and
	    IF  to rr-out0  ELSE  drop  THEN
	LOOP
	LOOP
	rr-crt0 XRRCrtcInfo-width l@
	rr-crt0 XRRCrtcInfo-width l@
    rr-crt0 XRRCrtcInfo-height l@ ;
	rr-crt0 XRRCrtcInfo-height l@
	2dup d0<> IF  unloop  EXIT  THEN  2drop
    LOOP \ fallback: screen struct
    screen-struct Screen-width l@
    screen-struct Screen-height l@ ;


4 buffer: spot \ spot location, two shorts
4 buffer: spot \ spot location, two shorts