XSelection.hs: simplify creation of window

While spelunking in the xclip source code, I noticed it had much the same call to createSimpleWindow but with a simpler geometry - just 1x1 pixels, not the odd 200x100 of the original code. It seems to work the same and looks better and less mysterious, so unless arossato had a specific reason for those particular two numbers...
This commit is contained in:
gwern0
2007-10-19 01:00:13 +00:00
parent 710aa7efb9
commit f0eb0f0311

View File

@@ -65,7 +65,7 @@ getSelection = do
dpy <- openDisplay ""
let dflt = defaultScreen dpy
rootw <- rootWindow dpy dflt
win <- createSimpleWindow dpy rootw 0 0 200 100 0 0 0
win <- createSimpleWindow dpy rootw 0 0 1 1 0 0 0
p <- internAtom dpy "PRIMARY" True
ty <- E.catch
(E.catch
@@ -88,7 +88,7 @@ putSelection text = do
dpy <- openDisplay ""
let dflt = defaultScreen dpy
rootw <- rootWindow dpy dflt
win <- createSimpleWindow dpy rootw 0 0 200 100 0 0 0
win <- createSimpleWindow dpy rootw 0 0 1 1 0 0 0
p <- internAtom dpy "PRIMARY" True
ty <- internAtom dpy "UTF8_STRING" False
xSetSelectionOwner dpy p win currentTime