From f0eb0f031134ad84b8d9965f451c8c5d4c3173e0 Mon Sep 17 00:00:00 2001 From: gwern0 Date: Fri, 19 Oct 2007 01:00:13 +0000 Subject: [PATCH] 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... --- XSelection.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/XSelection.hs b/XSelection.hs index 49f27608..45547d75 100644 --- a/XSelection.hs +++ b/XSelection.hs @@ -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