This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository e16.

View the commit online.

commit 304e66645cd83799572b7d2f80518779bb940a8b
Author: Kim Woelders <[email protected]>
AuthorDate: Fri Dec 23 08:04:11 2022 +0100

    extinitwin: Move null cursor definition to separate function
    
    Should make it a bit more clear what goes on here.
---
 src/extinitwin.c | 28 +++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)

diff --git a/src/extinitwin.c b/src/extinitwin.c
index 4be1b57d..5fb3d82c 100644
--- a/src/extinitwin.c
+++ b/src/extinitwin.c
@@ -85,24 +85,34 @@ _eiw_render_loop(EX_Window win, EImage * im, EiwData * d)
 
 static void         _eiw_window_loop(EX_Window win, EImage * im, EiwData * d);
 
-static EiwLoopFunc *
-_eiw_window_init(EX_Window win, EiwData * d)
+static              EX_Cursor
+_DefineNullCursor(EX_Window win)
 {
+   EX_Cursor           curs;
    EX_Pixmap           pmap, mask;
-   XColor              cl;
+   XColor              cl = { };
+
+   pmap = XCreatePixmap(disp, win, 16, 16, 1);
+   EXFillAreaSolid(pmap, 0, 0, 16, 16, 0);
+   mask = pmap;
+
+   curs = XCreatePixmapCursor(disp, pmap, mask, &cl, &cl, 0, 0);
+
+   XFreePixmap(disp, pmap);
 
+   return curs;
+}
+
+static EiwLoopFunc *
+_eiw_window_init(EX_Window win, EiwData * d)
+{
    d->cwin = XCreateWindow(disp, WinGetXwin(RROOT), 0, 0, 32, 32, 0,
 			   CopyFromParent, InputOutput, CopyFromParent,
 			   CWOverrideRedirect | CWBackingStore | CWBackPixel,
 			   &d->attr);
 
-   pmap = XCreatePixmap(disp, d->cwin, 16, 16, 1);
-   EXFillAreaSolid(pmap, 0, 0, 16, 16, 0);
-
-   mask = XCreatePixmap(disp, d->cwin, 16, 16, 1);
-   EXFillAreaSolid(mask, 0, 0, 16, 16, 0);
+   d->curs = _DefineNullCursor(d->cwin);
 
-   d->curs = XCreatePixmapCursor(disp, pmap, mask, &cl, &cl, 0, 0);
    XDefineCursor(disp, win, d->curs);
    XDefineCursor(disp, d->cwin, d->curs);
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to