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 1a0e665e58905c2164091012d6ffe867feac54a2 (commit)
via 1bec2efba007da49ffbdab45d86448e129086666 (commit)
via 72f359be44ef6172d610c3550094a3de7a50cc80 (commit)
via cf9f0ec67ee3a3f5eb7303331ba76044fb2e065a (commit)
via 3adc058421a2261f825d4e99f9660c78ab8d2154 (commit)
from ebe9a27e8d72a30f85af074ab72033254e0f5a07 (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/1a0e665e58905c2164091012d6ffe867feac54a2
commit 1a0e665e58905c2164091012d6ffe867feac54a2
Author: Rodolfo GarcÃa Peñas (kix) <[email protected]>
Date: Sun Mar 4 17:14:28 2012 +0100
WindowMaker: icon.c comments added
Some comments added to icon.c file.
diff --git a/src/icon.c b/src/icon.c
index 40abbfb..f64a755 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -574,15 +574,19 @@ void wIconUpdate(WIcon * icon)
icon->pixmap = makeIcon(scr, wwin->net_icon_image,
icon->show_title,
icon->shadowed,
icon->tile_type, icon->highlighted);
} else if (wwin && wwin->wm_hints && (wwin->wm_hints->flags &
IconPixmapHint)) {
+ /* Get the Pixmap from the wm_hints, else, from the user */
if (get_pixmap_icon_from_wm_hints(scr, wwin, icon))
get_pixmap_icon_from_user_icon(scr, icon);
} else {
+ /* Get the Pixmap from the user */
get_pixmap_icon_from_user_icon(scr, icon);
}
+ /* No pixmap, set default background */
if (icon->pixmap != None)
XSetWindowBackgroundPixmap(dpy, icon->core->window,
icon->pixmap);
+ /* Paint it */
XClearWindow(dpy, icon->core->window);
wIconPaint(icon);
}
@@ -611,6 +615,7 @@ void get_pixmap_icon_from_user_icon(WScreen *scr, WIcon *
icon)
} else {
wwarning(_("could not find default icon
"%s""), file);
}
+ /* FIXME: Probably wfree(file) here! */
}
image = wIconValidateIconSize(scr, image,
wPreferences.icon_size);
http://repo.or.cz/w/wmaker-crm.git/commit/1bec2efba007da49ffbdab45d86448e129086666
commit 1bec2efba007da49ffbdab45d86448e129086666
Author: Rodolfo GarcÃa Peñas (kix) <[email protected]>
Date: Sun Mar 4 16:37:22 2012 +0100
WindowMaker: icon.c goto removed
The goto "make_icons" in icon.c was removed.
diff --git a/src/icon.c b/src/icon.c
index 30a41e1..40abbfb 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -589,31 +589,29 @@ void wIconUpdate(WIcon * icon)
void get_pixmap_icon_from_user_icon(WScreen *scr, WIcon * icon)
{
+ RImage *image = NULL;
+ char *path;
+ char *file;
+
if (icon->file_image) {
icon->pixmap = makeIcon(scr, icon->file_image, icon->show_title,
icon->shadowed, icon->tile_type,
icon->highlighted);
} else {
/* make default icons */
if (!scr->def_icon_pixmap) {
- RImage *image = NULL;
- char *path;
- char *file;
-
file = wDefaultGetIconFile(scr, NULL, NULL, False);
if (file) {
path = FindImage(wPreferences.icon_path, file);
- if (!path) {
+ if (path) {
+ image = RLoadImage(scr->rcontext, path,
0);
+ if (!image)
+ wwarning(_("could not load
default icon "%s":%s"),
+ file,
RMessageForError(RErrorCode));
+ wfree(path);
+ } else {
wwarning(_("could not find default icon
"%s""), file);
- goto make_icons;
}
-
- image = RLoadImage(scr->rcontext, path, 0);
- if (!image)
- wwarning(_("could not load default icon
"%s":%s"),
- file,
RMessageForError(RErrorCode));
- wfree(path);
}
- make_icons:
image = wIconValidateIconSize(scr, image,
wPreferences.icon_size);
scr->def_icon_pixmap = makeIcon(scr, image, False,
False, icon->tile_type, icon->highlighted);
http://repo.or.cz/w/wmaker-crm.git/commit/72f359be44ef6172d610c3550094a3de7a50cc80
commit 72f359be44ef6172d610c3550094a3de7a50cc80
Author: Rodolfo GarcÃa Peñas (kix) <[email protected]>
Date: Sun Mar 4 16:27:14 2012 +0100
WindowMaker: New function get_pixmap_icon_from_user_icon
The new function get_pixmap_icon_from_user_icon() splits the
function wIconUpdate().
diff --git a/src/icon.c b/src/icon.c
index 8663e69..30a41e1 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -58,6 +58,7 @@ static void miniwindowDblClick(WObjDescriptor * desc, XEvent
* event);
void get_pixmap_icon_from_icon_win(WIcon *icon);
int get_pixmap_icon_from_wm_hints(WScreen *scr, WWindow *wwin, WIcon *icon);
+void get_pixmap_icon_from_user_icon(WScreen *scr, WIcon * icon);
/****** Notification Observers ******/
static void appearanceObserver(void *self, WMNotification * notif)
@@ -562,10 +563,10 @@ void wIconUpdate(WIcon * icon)
XFreePixmap(dpy, icon->pixmap);
icon->pixmap = None;
- if (wwin && WFLAGP(wwin, always_user_icon))
- goto user_icon;
-
- if (icon->icon_win != None) {
+ if (wwin && WFLAGP(wwin, always_user_icon)) {
+ /* Forced use user_icon */
+ get_pixmap_icon_from_user_icon(scr, icon);
+ } else if (icon->icon_win != None) {
/* Get the Pixmap from the WIcon */
get_pixmap_icon_from_icon_win(icon);
} else if (wwin && wwin->net_icon_image) {
@@ -574,50 +575,11 @@ void wIconUpdate(WIcon * icon)
icon->shadowed,
icon->tile_type, icon->highlighted);
} else if (wwin && wwin->wm_hints && (wwin->wm_hints->flags &
IconPixmapHint)) {
if (get_pixmap_icon_from_wm_hints(scr, wwin, icon))
- goto user_icon;
+ get_pixmap_icon_from_user_icon(scr, icon);
} else {
- user_icon:
- if (icon->file_image) {
- icon->pixmap = makeIcon(scr, icon->file_image,
icon->show_title,
- icon->shadowed,
icon->tile_type, icon->highlighted);
- } else {
- /* make default icons */
- if (!scr->def_icon_pixmap) {
- RImage *image = NULL;
- char *path;
- char *file;
-
- file = wDefaultGetIconFile(scr, NULL, NULL,
False);
- if (file) {
- path =
FindImage(wPreferences.icon_path, file);
- if (!path) {
- wwarning(_("could not find
default icon "%s""), file);
- goto make_icons;
- }
-
- image = RLoadImage(scr->rcontext, path,
0);
- if (!image)
- wwarning(_("could not load
default icon "%s":%s"),
- file,
RMessageForError(RErrorCode));
- wfree(path);
- }
- make_icons:
-
- image = wIconValidateIconSize(scr, image,
wPreferences.icon_size);
- scr->def_icon_pixmap = makeIcon(scr, image,
False, False, icon->tile_type, icon->highlighted);
- scr->def_ticon_pixmap = makeIcon(scr, image,
True, False, icon->tile_type, icon->highlighted);
- if (image)
- RReleaseImage(image);
- }
-
- if (icon->show_title)
- XSetWindowBackgroundPixmap(dpy,
icon->core->window, scr->def_ticon_pixmap);
- else
- XSetWindowBackgroundPixmap(dpy,
icon->core->window, scr->def_icon_pixmap);
-
- icon->pixmap = None;
- }
+ get_pixmap_icon_from_user_icon(scr, icon);
}
+
if (icon->pixmap != None)
XSetWindowBackgroundPixmap(dpy, icon->core->window,
icon->pixmap);
@@ -625,6 +587,50 @@ void wIconUpdate(WIcon * icon)
wIconPaint(icon);
}
+void get_pixmap_icon_from_user_icon(WScreen *scr, WIcon * icon)
+{
+ if (icon->file_image) {
+ icon->pixmap = makeIcon(scr, icon->file_image, icon->show_title,
+ icon->shadowed, icon->tile_type,
icon->highlighted);
+ } else {
+ /* make default icons */
+ if (!scr->def_icon_pixmap) {
+ RImage *image = NULL;
+ char *path;
+ char *file;
+
+ file = wDefaultGetIconFile(scr, NULL, NULL, False);
+ if (file) {
+ path = FindImage(wPreferences.icon_path, file);
+ if (!path) {
+ wwarning(_("could not find default icon
"%s""), file);
+ goto make_icons;
+ }
+
+ image = RLoadImage(scr->rcontext, path, 0);
+ if (!image)
+ wwarning(_("could not load default icon
"%s":%s"),
+ file,
RMessageForError(RErrorCode));
+ wfree(path);
+ }
+ make_icons:
+
+ image = wIconValidateIconSize(scr, image,
wPreferences.icon_size);
+ scr->def_icon_pixmap = makeIcon(scr, image, False,
False, icon->tile_type, icon->highlighted);
+ scr->def_ticon_pixmap = makeIcon(scr, image, True,
False, icon->tile_type, icon->highlighted);
+ if (image)
+ RReleaseImage(image);
+ }
+
+ if (icon->show_title)
+ XSetWindowBackgroundPixmap(dpy, icon->core->window,
scr->def_ticon_pixmap);
+ else
+ XSetWindowBackgroundPixmap(dpy, icon->core->window,
scr->def_icon_pixmap);
+
+ icon->pixmap = None;
+ }
+}
+
/* Get the Pixmap from the WIcon of the WWindow */
void get_pixmap_icon_from_icon_win(WIcon * icon)
{
http://repo.or.cz/w/wmaker-crm.git/commit/cf9f0ec67ee3a3f5eb7303331ba76044fb2e065a
commit cf9f0ec67ee3a3f5eb7303331ba76044fb2e065a
Author: Rodolfo GarcÃa Peñas (kix) <[email protected]>
Date: Sun Mar 4 14:54:45 2012 +0100
WindowMaker: New function get_pixmap_icon_from_wm_hints
The new function get_pixmap_icon_from_wm_hints() splits the
function wIconUpdate().
diff --git a/src/icon.c b/src/icon.c
index f522547..8663e69 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -57,6 +57,7 @@ static void miniwindowMouseDown(WObjDescriptor * desc, XEvent
* event);
static void miniwindowDblClick(WObjDescriptor * desc, XEvent * event);
void get_pixmap_icon_from_icon_win(WIcon *icon);
+int get_pixmap_icon_from_wm_hints(WScreen *scr, WWindow *wwin, WIcon *icon);
/****** Notification Observers ******/
static void appearanceObserver(void *self, WMNotification * notif)
@@ -553,7 +554,6 @@ void wIconSelect(WIcon * icon)
void wIconUpdate(WIcon * icon)
{
WScreen *scr = icon->core->screen_ptr;
- int title_height = WMFontHeight(scr->icon_title_font);
WWindow *wwin = icon->owner;
assert(scr->icon_tile != NULL);
@@ -573,59 +573,8 @@ void wIconUpdate(WIcon * icon)
icon->pixmap = makeIcon(scr, wwin->net_icon_image,
icon->show_title,
icon->shadowed,
icon->tile_type, icon->highlighted);
} else if (wwin && wwin->wm_hints && (wwin->wm_hints->flags &
IconPixmapHint)) {
- int x, y;
- unsigned int w, h;
- Window jw;
- int ji;
- unsigned int ju, d;
- Pixmap pixmap;
-
- if (!XGetGeometry(dpy, wwin->wm_hints->icon_pixmap, &jw, &ji,
&ji, &w, &h, &ju, &d)) {
- icon->owner->wm_hints->flags &= ~IconPixmapHint;
+ if (get_pixmap_icon_from_wm_hints(scr, wwin, icon))
goto user_icon;
- }
-
- pixmap = XCreatePixmap(dpy, icon->core->window,
wPreferences.icon_size,
- wPreferences.icon_size, scr->w_depth);
- XSetClipMask(dpy, scr->copy_gc, None);
- XCopyArea(dpy, scr->icon_tile_pixmap, pixmap, scr->copy_gc, 0,
0,
- wPreferences.icon_size, wPreferences.icon_size, 0, 0);
-
- if (w > wPreferences.icon_size)
- w = wPreferences.icon_size;
- x = (wPreferences.icon_size - w) / 2;
-
- if (icon->show_title && (title_height <
wPreferences.icon_size)) {
- drawIconTitle(scr, pixmap, title_height);
-
- if (h > wPreferences.icon_size - title_height - 2) {
- h = wPreferences.icon_size - title_height - 2;
- y = title_height + 1;
- } else {
- y = (wPreferences.icon_size - h - title_height)
/ 2 + title_height + 1;
- }
- } else {
- if (w > wPreferences.icon_size)
- w = wPreferences.icon_size;
- y = (wPreferences.icon_size - h) / 2;
- }
-
- if (wwin->wm_hints->flags & IconMaskHint)
- XSetClipMask(dpy, scr->copy_gc,
wwin->wm_hints->icon_mask);
-
- XSetClipOrigin(dpy, scr->copy_gc, x, y);
-
- if (d != scr->w_depth) {
- XSetForeground(dpy, scr->copy_gc, scr->black_pixel);
- XSetBackground(dpy, scr->copy_gc, scr->white_pixel);
- XCopyPlane(dpy, wwin->wm_hints->icon_pixmap, pixmap,
scr->copy_gc, 0, 0, w, h, x, y, 1);
- } else {
- XCopyArea(dpy, wwin->wm_hints->icon_pixmap, pixmap,
scr->copy_gc, 0, 0, w, h, x, y);
- }
-
- XSetClipOrigin(dpy, scr->copy_gc, 0, 0);
-
- icon->pixmap = pixmap;
} else {
user_icon:
if (icon->file_image) {
@@ -733,6 +682,63 @@ void get_pixmap_icon_from_icon_win(WIcon * icon)
None, wCursor[WCUR_ARROW]);
}
+/* Get the Pixmap from the XWindow wm_hints */
+int get_pixmap_icon_from_wm_hints(WScreen *scr, WWindow *wwin, WIcon *icon)
+{
+ Window jw;
+ Pixmap pixmap;
+ unsigned int w, h, ju, d;
+ int ji, x, y;
+ int title_height = WMFontHeight(scr->icon_title_font);
+
+ if (!XGetGeometry(dpy, wwin->wm_hints->icon_pixmap, &jw, &ji, &ji, &w,
&h, &ju, &d)) {
+ icon->owner->wm_hints->flags &= ~IconPixmapHint;
+ return(1);
+ }
+
+ pixmap = XCreatePixmap(dpy, icon->core->window, wPreferences.icon_size,
+ wPreferences.icon_size, scr->w_depth);
+ XSetClipMask(dpy, scr->copy_gc, None);
+ XCopyArea(dpy, scr->icon_tile_pixmap, pixmap, scr->copy_gc, 0, 0,
+ wPreferences.icon_size, wPreferences.icon_size, 0, 0);
+
+ if (w > wPreferences.icon_size)
+ w = wPreferences.icon_size;
+ x = (wPreferences.icon_size - w) / 2;
+
+ if (icon->show_title && (title_height < wPreferences.icon_size)) {
+ drawIconTitle(scr, pixmap, title_height);
+
+ if (h > wPreferences.icon_size - title_height - 2) {
+ h = wPreferences.icon_size - title_height - 2;
+ y = title_height + 1;
+ } else {
+ y = (wPreferences.icon_size - h - title_height) / 2 +
title_height + 1;
+ }
+ } else {
+ if (w > wPreferences.icon_size)
+ w = wPreferences.icon_size;
+ y = (wPreferences.icon_size - h) / 2;
+ }
+
+ if (wwin->wm_hints->flags & IconMaskHint)
+ XSetClipMask(dpy, scr->copy_gc, wwin->wm_hints->icon_mask);
+
+ XSetClipOrigin(dpy, scr->copy_gc, x, y);
+
+ if (d != scr->w_depth) {
+ XSetForeground(dpy, scr->copy_gc, scr->black_pixel);
+ XSetBackground(dpy, scr->copy_gc, scr->white_pixel);
+ XCopyPlane(dpy, wwin->wm_hints->icon_pixmap, pixmap,
scr->copy_gc, 0, 0, w, h, x, y, 1);
+ } else {
+ XCopyArea(dpy, wwin->wm_hints->icon_pixmap, pixmap,
scr->copy_gc, 0, 0, w, h, x, y);
+ }
+
+ XSetClipOrigin(dpy, scr->copy_gc, 0, 0);
+
+ icon->pixmap = pixmap;
+ return (0);
+}
void wIconPaint(WIcon * icon)
{
http://repo.or.cz/w/wmaker-crm.git/commit/3adc058421a2261f825d4e99f9660c78ab8d2154
commit 3adc058421a2261f825d4e99f9660c78ab8d2154
Author: Rodolfo GarcÃa Peñas (kix) <[email protected]>
Date: Sun Mar 4 13:15:27 2012 +0100
WindowMaker: New function get_pixmap_icon_from_icon_win
The new function get_pixmap_icon_from_icon_win() splits the
function wIconUpdate().
diff --git a/src/icon.c b/src/icon.c
index b5b9dbc..f522547 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -56,6 +56,7 @@ static void miniwindowExpose(WObjDescriptor * desc, XEvent *
event);
static void miniwindowMouseDown(WObjDescriptor * desc, XEvent * event);
static void miniwindowDblClick(WObjDescriptor * desc, XEvent * event);
+void get_pixmap_icon_from_icon_win(WIcon *icon);
/****** Notification Observers ******/
static void appearanceObserver(void *self, WMNotification * notif)
@@ -565,56 +566,8 @@ void wIconUpdate(WIcon * icon)
goto user_icon;
if (icon->icon_win != None) {
- /* use client specified icon window */
- XWindowAttributes attr;
- int resize = 0;
- unsigned int width, height, depth;
- int theight;
- Pixmap pixmap;
-
- getSize(icon->icon_win, &width, &height, &depth);
-
- if (width > wPreferences.icon_size) {
- resize = 1;
- width = wPreferences.icon_size;
- }
- if (height > wPreferences.icon_size) {
- resize = 1;
- height = wPreferences.icon_size;
- }
- if (icon->show_title && (height + title_height <
wPreferences.icon_size)) {
- pixmap = XCreatePixmap(dpy, scr->w_win,
wPreferences.icon_size,
- wPreferences.icon_size,
scr->w_depth);
- XSetClipMask(dpy, scr->copy_gc, None);
- XCopyArea(dpy, scr->icon_tile_pixmap, pixmap,
scr->copy_gc, 0, 0,
- wPreferences.icon_size,
wPreferences.icon_size, 0, 0);
- drawIconTitle(scr, pixmap, title_height);
- theight = title_height;
- } else {
- pixmap = None;
- theight = 0;
- XSetWindowBackgroundPixmap(dpy, icon->core->window,
scr->icon_tile_pixmap);
- }
-
- XSetWindowBorderWidth(dpy, icon->icon_win, 0);
- XReparentWindow(dpy, icon->icon_win, icon->core->window,
- (wPreferences.icon_size - width) / 2,
- theight + (wPreferences.icon_size - height -
theight) / 2);
- if (resize)
- XResizeWindow(dpy, icon->icon_win, width, height);
-
- XMapWindow(dpy, icon->icon_win);
-
- XAddToSaveSet(dpy, icon->icon_win);
-
- icon->pixmap = pixmap;
-
- if (XGetWindowAttributes(dpy, icon->icon_win, &attr)) {
- if (attr.all_event_masks & ButtonPressMask)
- wHackedGrabButton(Button1, MOD_MASK,
icon->core->window, True,
- ButtonPressMask,
GrabModeSync, GrabModeAsync,
- None, wCursor[WCUR_ARROW]);
- }
+ /* Get the Pixmap from the WIcon */
+ get_pixmap_icon_from_icon_win(icon);
} else if (wwin && wwin->net_icon_image) {
/* Use _NET_WM_ICON icon */
icon->pixmap = makeIcon(scr, wwin->net_icon_image,
icon->show_title,
@@ -723,6 +676,64 @@ void wIconUpdate(WIcon * icon)
wIconPaint(icon);
}
+/* Get the Pixmap from the WIcon of the WWindow */
+void get_pixmap_icon_from_icon_win(WIcon * icon)
+{
+ XWindowAttributes attr;
+ WScreen *scr = icon->core->screen_ptr;
+ int title_height = WMFontHeight(scr->icon_title_font);
+ unsigned int width, height, depth;
+ int theight;
+ int resize = 0;
+ Pixmap pixmap;
+
+ getSize(icon->icon_win, &width, &height, &depth);
+
+ if (width > wPreferences.icon_size) {
+ resize = 1;
+ width = wPreferences.icon_size;
+ }
+
+ if (height > wPreferences.icon_size) {
+ resize = 1;
+ height = wPreferences.icon_size;
+ }
+
+ if (icon->show_title && (height + title_height <
wPreferences.icon_size)) {
+ pixmap = XCreatePixmap(dpy, scr->w_win, wPreferences.icon_size,
+ wPreferences.icon_size, scr->w_depth);
+ XSetClipMask(dpy, scr->copy_gc, None);
+ XCopyArea(dpy, scr->icon_tile_pixmap, pixmap, scr->copy_gc, 0,
0,
+ wPreferences.icon_size, wPreferences.icon_size, 0, 0);
+ drawIconTitle(scr, pixmap, title_height);
+ theight = title_height;
+ } else {
+ pixmap = None;
+ theight = 0;
+ XSetWindowBackgroundPixmap(dpy, icon->core->window,
scr->icon_tile_pixmap);
+ }
+
+ XSetWindowBorderWidth(dpy, icon->icon_win, 0);
+ XReparentWindow(dpy, icon->icon_win, icon->core->window,
+ (wPreferences.icon_size - width) / 2,
+ theight + (wPreferences.icon_size - height - theight) /
2);
+ if (resize)
+ XResizeWindow(dpy, icon->icon_win, width, height);
+
+ XMapWindow(dpy, icon->icon_win);
+ XAddToSaveSet(dpy, icon->icon_win);
+
+ /* Save it */
+ icon->pixmap = pixmap;
+
+ if ((XGetWindowAttributes(dpy, icon->icon_win, &attr)) &&
+ (attr.all_event_masks & ButtonPressMask))
+ wHackedGrabButton(Button1, MOD_MASK,
icon->core->window, True,
+ ButtonPressMask, GrabModeSync,
GrabModeAsync,
+ None, wCursor[WCUR_ARROW]);
+}
+
+
void wIconPaint(WIcon * icon)
{
WScreen *scr = icon->core->screen_ptr;
-----------------------------------------------------------------------
Summary of changes:
src/icon.c | 292 +++++++++++++++++++++++++++++++++---------------------------
1 files changed, 159 insertions(+), 133 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].