This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project wmaker-crm.git.

The branch, next has been updated
       via  e357e94896ba5dfb05dcc22b077a52e66eba4f9f (commit)
       via  952f6bfb1cee41d7c4b0962d0acf94d82d698715 (commit)
       via  e3db102591e794bfb4054b69d284ce18f9bdf530 (commit)
      from  41af9ca07fcaa4687c3f5012bd1b745d88a7b256 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://repo.or.cz/w/wmaker-crm.git/commit/e357e94896ba5dfb05dcc22b077a52e66eba4f9f

commit e357e94896ba5dfb05dcc22b077a52e66eba4f9f
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Mon Oct 8 05:43:22 2012 +0200

    Icon creation in only one function
    
    This patch avoids the icon creation in winspector.c and adds the
    ability of creating + paiting and unpainting instead of destroying the icon.
    
    Now the icon is always created by wApplicationCreate and the icon
    exists while the application is runnning. If the user doesn't want
    an appicon the winspector.c will not remove the icon, it will only
    not paint it on the screen. But the icon is still created.
    
    Probably the most difficult part in this code is how to handle the
    icons in the iconlist. We must include the icon in the iconlist when
    it is painted, not when it is created. And it must be removed when it
    is unpainted.
    
    We can check if the icon is in the iconlist if icon->next AND icon->prev
    are null, else it is on the applist. If it is included we must not
    paint it again because the function PlaceIcon() will calculate a new
    icon place in the screen including the icon!, then a hole is painted.

diff --git a/src/appicon.c b/src/appicon.c
index a90e35b..f2dc957 100644
--- a/src/appicon.c
+++ b/src/appicon.c
@@ -157,6 +157,33 @@ void makeAppIconFor(WApplication *wapp)
                paint_app_icon(wapp);
 }
 
+void unpaint_app_icon(WApplication *wapp)
+{
+       WAppIcon *aicon;
+       WScreen *scr = wapp->main_window_desc->screen_ptr;
+       WDock *clip = scr->workspaces[scr->current_workspace]->clip;
+
+       if (!wapp || !wapp->app_icon)
+               return;
+
+       aicon = wapp->app_icon;
+
+       /* If the icon is docked, don't continue */
+       if (aicon->docked)
+               return;
+
+       if (!clip || !aicon->attracted || !clip->collapsed)
+               XUnmapWindow(dpy, aicon->icon->core->window);
+
+       /* We want to avoid having it on the list  because otherwise
+        * there will be a hole when the icons are arranged with
+        * wArrangeIcons() */
+       remove_from_appicon_list(scr, aicon);
+
+       if (wPreferences.auto_arrange_icons && !aicon->attracted)
+               wArrangeIcons(scr, True);
+}
+
 void paint_app_icon(WApplication *wapp)
 {
        WIcon *icon;
@@ -182,11 +209,23 @@ void paint_app_icon(WApplication *wapp)
                }
                wDockAttachIcon(clip, wapp->app_icon, x, y);
        } else {
-               PlaceIcon(scr, &x, &y, 
wGetHeadForWindow(wapp->main_window_desc));
-               wAppIconMove(wapp->app_icon, x, y);
-               wLowerFrame(icon->core);
+               /* We must know if the icon is painted in the screen,
+                * because if painted, then PlaceIcon will return the next
+                * space on the screen, and the icon will move */
+               if (wapp->app_icon->next == NULL && wapp->app_icon->prev == 
NULL) {
+                       PlaceIcon(scr, &x, &y, 
wGetHeadForWindow(wapp->main_window_desc));
+                       wAppIconMove(wapp->app_icon, x, y);
+                       wLowerFrame(icon->core);
+               }
        }
 
+       /* If we want appicon (no_appicon is not set) and the icon is not
+        * in the appicon_list, we must add it. Else, we want to avoid
+        * having it on the list */
+       if (!WFLAGP(wapp->main_window_desc, no_appicon) &&
+           wapp->app_icon->next == NULL && wapp->app_icon->prev == NULL)
+               add_to_appicon_list(scr, wapp->app_icon);
+
        if (!clip || !wapp->app_icon->attracted || !clip->collapsed)
                XMapWindow(dpy, icon->core->window);
 
@@ -226,18 +265,13 @@ void removeAppIconFor(WApplication * wapp)
 static WAppIcon *wAppIconCreate(WWindow *leader_win)
 {
        WAppIcon *aicon;
-       WScreen *scr = leader_win->screen_ptr;
 
        aicon = wmalloc(sizeof(WAppIcon));
        wretain(aicon);
        aicon->yindex = -1;
        aicon->xindex = -1;
-
-       /* When no_appicon is set we want to avoid having it on the list
-        * because otherwise there will be a hole when the icons are
-        * arranged with wArrangeIcons() */
-       if (!WFLAGP(leader_win, no_appicon))
-               add_to_appicon_list(scr, aicon);
+       aicon->prev = NULL;
+       aicon->next = NULL;
 
        if (leader_win->wm_class)
                aicon->wm_class = wstrdup(leader_win->wm_class);
@@ -975,4 +1009,7 @@ static void remove_from_appicon_list(WScreen *scr, 
WAppIcon *appicon)
                if (appicon->prev)
                        appicon->prev->next = appicon->next;
        }
+
+       appicon->prev = NULL;
+       appicon->next = NULL;
 }
diff --git a/src/appicon.h b/src/appicon.h
index 280843c..a6c6a6a 100644
--- a/src/appicon.h
+++ b/src/appicon.h
@@ -80,6 +80,7 @@ void makeAppIconFor(WApplication * wapp);
 void removeAppIconFor(WApplication * wapp);
 void save_appicon(WAppIcon *aicon, Bool dock);
 void paint_app_icon(WApplication *wapp);
+void unpaint_app_icon(WApplication *wapp);
 void wApplicationExtractDirPackIcon(WScreen * scr, char *path, char 
*wm_instance,
                                    char *wm_class);
 #endif
diff --git a/src/winspector.c b/src/winspector.c
index 184aec7..30b88f2 100644
--- a/src/winspector.c
+++ b/src/winspector.c
@@ -770,15 +770,13 @@ static void applySettings(WMButton *button, 
InspectorPanel *panel)
        if (wapp) {
                /* do application wide stuff */
                WSETUFLAG(wapp->main_window_desc, start_hidden, 
WMGetButtonSelected(panel->appChk[0]));
-
                WSETUFLAG(wapp->main_window_desc, no_appicon, 
WMGetButtonSelected(panel->appChk[1]));
-
                WSETUFLAG(wapp->main_window_desc, shared_appicon, 
WMGetButtonSelected(panel->appChk[2]));
 
                if (WFLAGP(wapp->main_window_desc, no_appicon))
-                       removeAppIconFor(wapp);
+                       unpaint_app_icon(wapp);
                else
-                       makeAppIconFor(wapp);
+                       paint_app_icon(wapp);
 
                if (wapp->app_icon && wapp->main_window == wwin->client_win) {
                        char *file = WMGetTextFieldText(panel->fileText);

http://repo.or.cz/w/wmaker-crm.git/commit/952f6bfb1cee41d7c4b0962d0acf94d82d698715

commit 952f6bfb1cee41d7c4b0962d0acf94d82d698715
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Sat Oct 6 18:18:43 2012 +0200

    wcore set vmask in one step
    
    This patch set the vmask in one line.
    
    - vmask = CWBorderPixel | CWCursor | CWEventMask | CWOverrideRedirect;
    - vmask |= CWColormap;
    
    Is similar to:
    
    + vmask = CWBorderPixel | CWCursor | CWEventMask | CWOverrideRedirect | 
CWColormap;
    
    And vmask is not used between the two original lines, therefore we can do 
the
    initialization in only one line.

diff --git a/src/wcore.c b/src/wcore.c
index ce57942..1abe842 100644
--- a/src/wcore.c
+++ b/src/wcore.c
@@ -51,7 +51,7 @@ WCoreWindow *wCoreCreateTopLevel(WScreen *screen, int x, int 
y, int width, int h
 
        core = wmalloc(sizeof(WCoreWindow));
 
-       vmask = CWBorderPixel | CWCursor | CWEventMask | CWOverrideRedirect;
+       vmask = CWBorderPixel | CWCursor | CWEventMask | CWOverrideRedirect | 
CWColormap;
        attribs.override_redirect = True;
        attribs.cursor = wCursor[WCUR_DEFAULT];
        attribs.background_pixmap = None;
@@ -61,7 +61,6 @@ WCoreWindow *wCoreCreateTopLevel(WScreen *screen, int x, int 
y, int width, int h
                             ButtonReleaseMask | ButtonMotionMask |
                             ExposureMask | EnterWindowMask | LeaveWindowMask;
 
-       vmask |= CWColormap;
        attribs.colormap = colormap;
 
        core->window = XCreateWindow(dpy, screen->root_win, x, y, width, height,
@@ -99,14 +98,13 @@ WCoreWindow *wCoreCreate(WCoreWindow *parent, int x, int y, 
int width, int heigh
 
        core = wmalloc(sizeof(WCoreWindow));
 
-       vmask = CWBorderPixel | CWCursor | CWEventMask;
+       vmask = CWBorderPixel | CWCursor | CWEventMask | CWColormap;
        attribs.cursor = wCursor[WCUR_DEFAULT];
        attribs.background_pixmap = None;
        attribs.background_pixel = parent->screen_ptr->black_pixel;
        attribs.event_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask |
                             ButtonReleaseMask | ButtonMotionMask |
                             ExposureMask | EnterWindowMask | LeaveWindowMask;
-       vmask |= CWColormap;
        attribs.colormap = parent->screen_ptr->w_colormap;
        core->window = XCreateWindow(dpy, parent->window, x, y, width, height, 
0,
                          parent->screen_ptr->w_depth, CopyFromParent,

http://repo.or.cz/w/wmaker-crm.git/commit/e3db102591e794bfb4054b69d284ce18f9bdf530

commit e3db102591e794bfb4054b69d284ce18f9bdf530
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Sat Oct 6 17:58:52 2012 +0200

    wmcore code clean
    
    This patch changes spaces with tabs, make the comments shorter and removes
    some old comments.

diff --git a/src/wcore.c b/src/wcore.c
index 241ede4..ce57942 100644
--- a/src/wcore.c
+++ b/src/wcore.c
@@ -34,19 +34,16 @@ extern WPreferences wPreferences;
 
 /* cursors */
 extern Cursor wCursor[WCUR_LAST];
-
 extern XContext wWinContext;
 
-/*
- *----------------------------------------------------------------------
+/*----------------------------------------------------------------------
  * wCoreCreateTopLevel--
  *     Creates a toplevel window used for icons, menus and dialogs.
  *
  * Returns:
  *     The created window.
- *----------------------------------------------------------------------
- */
-WCoreWindow *wCoreCreateTopLevel(WScreen * screen, int x, int y, int width, 
int height, int bwidth, int depth, Visual *visual, Colormap colormap)
+ *--------------------------------------------------------------------- */
+WCoreWindow *wCoreCreateTopLevel(WScreen *screen, int x, int y, int width, int 
height, int bwidth, int depth, Visual *visual, Colormap colormap)
 {
        WCoreWindow *core;
        int vmask;
@@ -54,17 +51,15 @@ WCoreWindow *wCoreCreateTopLevel(WScreen * screen, int x, 
int y, int width, int
 
        core = wmalloc(sizeof(WCoreWindow));
 
-       /* don't set CWBackPixel so that transparent XRender windows
-          are see-through */
-       vmask = /*CWBackPixmap|CWBackPixel| */ CWBorderPixel | CWCursor | 
CWEventMask
-           | CWOverrideRedirect;
+       vmask = CWBorderPixel | CWCursor | CWEventMask | CWOverrideRedirect;
        attribs.override_redirect = True;
        attribs.cursor = wCursor[WCUR_DEFAULT];
        attribs.background_pixmap = None;
        attribs.background_pixel = screen->black_pixel;
        attribs.border_pixel = screen->frame_border_pixel;
-       attribs.event_mask = SubstructureRedirectMask | ButtonPressMask
-           | ButtonReleaseMask | ButtonMotionMask | ExposureMask | 
EnterWindowMask | LeaveWindowMask;
+       attribs.event_mask = SubstructureRedirectMask | ButtonPressMask |
+                            ButtonReleaseMask | ButtonMotionMask |
+                            ExposureMask | EnterWindowMask | LeaveWindowMask;
 
        vmask |= CWColormap;
        attribs.colormap = colormap;
@@ -74,18 +69,15 @@ WCoreWindow *wCoreCreateTopLevel(WScreen * screen, int x, 
int y, int width, int
        core->width = width;
        core->height = height;
        core->screen_ptr = screen;
-
        core->descriptor.self = core;
 
        XClearWindow(dpy, core->window);
-
        XSaveContext(dpy, core->window, wWinContext, (XPointer) & 
core->descriptor);
 
        return core;
 }
 
-/*
- *----------------------------------------------------------------------
+/*----------------------------------------------------------------------
  * wCoreCreate--
  *     Creates a brand new child window.
  *     The window will have a border width of 0 and color is black.
@@ -98,10 +90,8 @@ WCoreWindow *wCoreCreateTopLevel(WScreen * screen, int x, 
int y, int width, int
  *
  * Notes:
  *     The event mask is initialized to a default value.
- *
- *----------------------------------------------------------------------
- */
-WCoreWindow *wCoreCreate(WCoreWindow * parent, int x, int y, int width, int 
height)
+ *--------------------------------------------------------------------- */
+WCoreWindow *wCoreCreate(WCoreWindow *parent, int x, int y, int width, int 
height)
 {
        WCoreWindow *core;
        int vmask;
@@ -109,22 +99,22 @@ WCoreWindow *wCoreCreate(WCoreWindow * parent, int x, int 
y, int width, int heig
 
        core = wmalloc(sizeof(WCoreWindow));
 
-       vmask = /*CWBackPixmap|CWBackPixel| */ CWBorderPixel | CWCursor | 
CWEventMask;
+       vmask = CWBorderPixel | CWCursor | CWEventMask;
        attribs.cursor = wCursor[WCUR_DEFAULT];
        attribs.background_pixmap = None;
        attribs.background_pixel = parent->screen_ptr->black_pixel;
-       attribs.event_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask
-           | ButtonReleaseMask | ButtonMotionMask | ExposureMask | 
EnterWindowMask | LeaveWindowMask;
+       attribs.event_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask |
+                            ButtonReleaseMask | ButtonMotionMask |
+                            ExposureMask | EnterWindowMask | LeaveWindowMask;
        vmask |= CWColormap;
        attribs.colormap = parent->screen_ptr->w_colormap;
-       core->window =
-           XCreateWindow(dpy, parent->window, x, y, width, height, 0,
+       core->window = XCreateWindow(dpy, parent->window, x, y, width, height, 
0,
                          parent->screen_ptr->w_depth, CopyFromParent,
                          parent->screen_ptr->w_visual, vmask, &attribs);
+
        core->width = width;
        core->height = height;
        core->screen_ptr = parent->screen_ptr;
-
        core->descriptor.self = core;
 
        XSaveContext(dpy, core->window, wWinContext, (XPointer) & 
core->descriptor);
@@ -133,9 +123,9 @@ WCoreWindow *wCoreCreate(WCoreWindow * parent, int x, int 
y, int width, int heig
 
 void wCoreDestroy(WCoreWindow * core)
 {
-       if (core->stacking) {
+       if (core->stacking)
                wfree(core->stacking);
-       }
+
        XDeleteContext(dpy, core->window, wWinContext);
        XDestroyWindow(dpy, core->window);
        wfree(core);
@@ -152,6 +142,7 @@ void wCoreConfigure(WCoreWindow * core, int req_x, int 
req_y, int req_w, int req
 
        if (req_w <= 0)
                req_w = core->width;
+
        if (req_h <= 0)
                req_h = core->height;
 
diff --git a/src/wcore.h b/src/wcore.h
index 3452227..4e626cc 100644
--- a/src/wcore.h
+++ b/src/wcore.h
@@ -25,32 +25,30 @@
 #include "screen.h"
 
 typedef struct WStacking {
-    struct _WCoreWindow *above;
-    struct _WCoreWindow *under;
-    short window_level;
-    struct _WCoreWindow *child_of;      /* owner for transient window */
+       struct _WCoreWindow *above;
+       struct _WCoreWindow *under;
+       short window_level;
+       struct _WCoreWindow *child_of;  /* owner for transient window */
 } WStacking;
 
 typedef struct _WCoreWindow {
-    Window window;
-    int width;                        /* size of the window */
-    int height;
-    WScreen *screen_ptr;              /* ptr to screen of the window */
+       Window window;
+       int width;                      /* size of the window */
+       int height;
+       WScreen *screen_ptr;            /* ptr to screen of the window */
 
-    WObjDescriptor descriptor;
-    WStacking *stacking;              /* window stacking information */
+       WObjDescriptor descriptor;
+       WStacking *stacking;            /* window stacking information */
 } WCoreWindow;
 
-
 WCoreWindow *wCoreCreateTopLevel(WScreen *screen, int x, int y, int width,
-                                 int height, int bwidth,
-                                 int depth, Visual *visual, Colormap colormap);
+                                int height, int bwidth,
+                                int depth, Visual *visual, Colormap colormap);
 
 WCoreWindow *wCoreCreate(WCoreWindow *parent, int x, int y,
-                         int width, int height);
+                        int width, int height);
+
 void wCoreDestroy(WCoreWindow *core);
 void wCoreConfigure(WCoreWindow *core, int req_x, int req_y,
-                    int req_w, int req_h);
-
-
+                   int req_w, int req_h);
 #endif

-----------------------------------------------------------------------

Summary of changes:
 src/appicon.c    |   57 ++++++++++++++++++++++++++++++++++++++++++++---------
 src/appicon.h    |    1 +
 src/wcore.c      |   49 ++++++++++++++++++----------------------------
 src/wcore.h      |   32 ++++++++++++++----------------
 src/winspector.c |    6 +---
 5 files changed, 84 insertions(+), 61 deletions(-)


repo.or.cz automatic notification. Contact project admin [email protected]
if you want to unsubscribe, or site admin [email protected] if you receive
no reply.
-- 
wmaker-crm.git ("The Window Maker window manager")


-- 
To unsubscribe, send mail to [email protected].

Reply via email to