Re: Patch: Partial support for partial struts

2012-10-31 Thread BALATON Zoltan

On Wed, 31 Oct 2012, Carlos R. Mafra wrote:

My first impression is that wArrangeIcons() should be called
when appicons are removed (because they can leave a hole).
But when they are created, why do we care? Aren't they simply
supposed to be appended (eg to the right) of the existing
appicons?


I'm not completely sure about that but I think Auto-arrange icons also 
makes sure that app icons and miniwindows are not mixed together but 
appicons precede miniwindows. This means that miniwindows may need to be 
shifted if a new appicon is created and also when removed. Does that make 
sense?


Regards,
BALATON Zoltan


--
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.


[PATCH 1/9] Removed dup code at get_default_image

2012-10-31 Thread kix
From: Rodolfo García Peñas (kix) k...@kix.es

This patch removes the code dup at get_default_image. Now,
this function calls get_rimage_from_file()
---
 src/icon.c |   16 +---
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/src/icon.c b/src/icon.c
index b4ccfc5..da93679 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -649,19 +649,13 @@ static RImage *get_default_image(WScreen *scr)
file = wDefaultGetIconFile(NULL, NULL, True);
if (file) {
path = FindImage(wPreferences.icon_path, file);
-   if (path) {
-   image = RLoadImage(scr-rcontext, path, 0);
-   if (!image)
-   wwarning(_(could not load default icon 
\%s\:%s),
-file, RMessageForError(RErrorCode));
-   wfree(path);
-   } else {
+   image = get_rimage_from_file(scr, path, wPreferences.icon_size);
+
+   if (!image)
wwarning(_(could not find default icon \%s\), file);
-   }
-   }
 
-   /* Validate the icon size */
-   image = wIconValidateIconSize(image, wPreferences.icon_size);
+   wfree(file);
+   }
 
return image;
 }
-- 
1.7.10.4


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.


[PATCH 3/9] wIconChangeImageFile removed dup code

2012-10-31 Thread kix
From: Rodolfo García Peñas (kix) k...@kix.es

This patch removes the dup code with get_rimage_from_file.
---
 src/icon.c |   18 ++
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/src/icon.c b/src/icon.c
index 94d9567..0b95df2 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -369,10 +369,9 @@ RImage *wIconValidateIconSize(RImage *icon, int max_size)
return icon;
 }
 
-Bool wIconChangeImageFile(WIcon * icon, char *file)
+Bool wIconChangeImageFile(WIcon *icon, char *file)
 {
WScreen *scr = icon-core-screen_ptr;
-   RImage *image;
char *path;
int error = 0;
 
@@ -385,17 +384,20 @@ Bool wIconChangeImageFile(WIcon * icon, char *file)
}
 
path = FindImage(wPreferences.icon_path, file);
+   if (path) {
+   icon-file_image = get_rimage_from_file(scr, path, 
wPreferences.icon_size);
+   if (icon-file_image) {
+   icon-file = wstrdup(path);
+   wIconUpdate(icon);
+   } else {
+   error = 1;
+   }
 
-   if (path  (image = RLoadImage(scr-rcontext, path, 0))) {
-   icon-file_image = wIconValidateIconSize(image, 
wPreferences.icon_size);
-   wIconUpdate(icon);
+   wfree(path);
} else {
error = 1;
}
 
-   if (path)
-   wfree(path);
-
return !error;
 }
 
-- 
1.7.10.4


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.


[PATCH 2/9] wIconChangeImageFile don't update without file

2012-10-31 Thread kix
From: Rodolfo García Peñas (kix) k...@kix.es

The function wIconChangeImageFile mustn't update the icon if
no file is set.

This is a bug. To reproduce it:

1. Right click on dock icon. Select Settings
2. Erase the Icon Image contents (set empty)
3. Click OK - Exit, no changes... no?
4. Right click on the same dock icon. Select Settings
5. Erase the Icon Image contents (set empty)
6. Click OK - Crash

If wmaker don't crash, watch the file ~/GNUstep/Defaults/WMWindowAttributes,
the default icon (* has trash in the name). Probably something is not fine
at wIconUpdate.
---
 src/icon.c |8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/icon.c b/src/icon.c
index da93679..94d9567 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -376,16 +376,14 @@ Bool wIconChangeImageFile(WIcon * icon, char *file)
char *path;
int error = 0;
 
+   if (!file)
+   return True;
+
if (icon-file_image) {
RReleaseImage(icon-file_image);
icon-file_image = NULL;
}
 
-   if (!file) {
-   wIconUpdate(icon);
-   return True;
-   }
-
path = FindImage(wPreferences.icon_path, file);
 
if (path  (image = RLoadImage(scr-rcontext, path, 0))) {
-- 
1.7.10.4


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.


[PATCH 6/9] CachedPixmaps added as pixmap folder

2012-10-31 Thread kix
From: Rodolfo García Peñas (kix) k...@kix.es

The CachedPixmap folder is added to the icon list. This is because
if one icon is created, but the user change it and set other icon, the first
icon cannot be selected anymore using the settings window. The user
needs modify the configuration files by hand.

Some extra paths are added to the debian default config file.
---
 WindowMaker/Defaults/WindowMaker.in |2 ++
 debian/debianfiles/conf/WindowMaker |   19 ---
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/WindowMaker/Defaults/WindowMaker.in 
b/WindowMaker/Defaults/WindowMaker.in
index 6b2890d..3e576be 100644
--- a/WindowMaker/Defaults/WindowMaker.in
+++ b/WindowMaker/Defaults/WindowMaker.in
@@ -14,6 +14,7 @@
 #pkgdatadir#/Pixmaps,
 /usr/include/X11/pixmaps,
 ~/GNUstep/Library/WindowMaker/Pixmaps,
+~/GNUstep/Library/WindowMaker/CachedPixmaps,
 /usr/share/icons,
 /usr/local/share/pixmaps,
 /usr/share/pixmaps
@@ -21,6 +22,7 @@
   PixmapPath = (
 ~/GNUstep/Library/WindowMaker/Pixmaps,
 ~/GNUstep/Library/WindowMaker/Backgrounds,
+~/GNUstep/Library/WindowMaker/CachedPixmaps,
 #pkgdatadir#/Pixmaps,
 #pkgdatadir#/Backgrounds,
 /usr/include/X11/pixmaps,
diff --git a/debian/debianfiles/conf/WindowMaker 
b/debian/debianfiles/conf/WindowMaker
index 3d0bb75..cc36e7c 100644
--- a/debian/debianfiles/conf/WindowMaker
+++ b/debian/debianfiles/conf/WindowMaker
@@ -11,20 +11,25 @@
   IconificationStyle = Zoom;
   IconPath = (
 ~/GNUstep/Library/Icons,
-/usr/local/share/WindowMaker/Icons,
+~/GNUstep/Library/WindowMaker/Pixmaps,
+~/GNUstep/Library/WindowMaker/CachedPixmaps,
 /usr/share/WindowMaker/Icons,
-/usr/local/share/icons,
-/usr/share/icons
+/usr/share/WindowMaker/Pixmaps,
+/usr/share/icons,
+/usr/local/share/WindowMaker/Icons,
+/usr/local/share/WindowMaker/Pixmaps,
+/usr/local/share/icons
   );
   PixmapPath = (
 ~/GNUstep/Library/WindowMaker/Pixmaps,
 ~/GNUstep/Library/WindowMaker/Backgrounds,
-/usr/local/share/WindowMaker/Pixmaps,
-/usr/local/share/WindowMaker/Backgrounds,
+~/GNUstep/Library/WindowMaker/CachedPixmaps,
 /usr/share/WindowMaker/Backgrounds,
 /usr/share/WindowMaker/Pixmaps,
-/usr/local/share/pixmaps,
-/usr/share/pixmaps
+/usr/share/pixmaps,
+/usr/local/share/WindowMaker/Pixmaps,
+/usr/local/share/WindowMaker/Backgrounds,
+/usr/local/share/pixmaps
   );
   WindowTitleBalloons = YES;
   IconSize = 64;
-- 
1.7.10.4


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.


[PATCH 5/9] wIconChangeImageFile non negated value

2012-10-31 Thread kix
From: Rodolfo García Peñas (kix) k...@kix.es

The flag (declared as int, not Bool) error was negated in the return
sentences because is set to 1 when error. Is better set a positive flag,
like ok_flag (declared as Boolean, like the function returned value)
and set to False when error is found. The the function can return the
flag without negate it.
---
 src/icon.c |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/icon.c b/src/icon.c
index f693e77..cb69b00 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -374,21 +374,21 @@ Bool wIconChangeImageFile(WIcon *icon, char *file)
WScreen *scr = icon-core-screen_ptr;
char *path;
RImage *image = NULL;
-   int error = 0;
+   Bool ok_flag = True;
 
/* If no new image, don't do nothing */
if (!file)
-   return True;
+   return ok_flag;
 
/* Find the new image */
path = FindImage(wPreferences.icon_path, file);
if (path)
image = get_rimage_from_file(scr, path, wPreferences.icon_size);
else
-   error = 1;
+   ok_flag = False;
 
/* New image! */
-   if (!error  image) {
+   if (ok_flag  image) {
/* Remove the old one */
if (icon-file_image) {
RReleaseImage(icon-file_image);
@@ -400,13 +400,13 @@ Bool wIconChangeImageFile(WIcon *icon, char *file)
icon-file = wstrdup(path);
wIconUpdate(icon);
} else {
-   error = 1;
+   ok_flag = False;
}
 
if (path)
wfree(path);
 
-   return !error;
+   return ok_flag;
 }
 
 static char *get_name_for_wwin(WWindow *wwin)
-- 
1.7.10.4


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.


[PATCH 7/9] getSize returns XGetGeometry exit

2012-10-31 Thread kix
From: Rodolfo García Peñas (kix) k...@kix.es

The function getSize now returns the returned value by XGetGeometry.
The function now is not INLINE.
---
 src/icon.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/icon.c b/src/icon.c
index cb69b00..448332a 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -97,13 +97,13 @@ static void tileObserver(void *self, WMNotification * notif)
 
 //
 
-INLINE static void getSize(Drawable d, unsigned int *w, unsigned int *h, 
unsigned int *dep)
+static int getSize(Drawable d, unsigned int *w, unsigned int *h, unsigned int 
*dep)
 {
Window rjunk;
int xjunk, yjunk;
unsigned int bjunk;
 
-   XGetGeometry(dpy, d, rjunk, xjunk, yjunk, w, h, bjunk, dep);
+   return XGetGeometry(dpy, d, rjunk, xjunk, yjunk, w, h, bjunk, dep);
 }
 
 WIcon *icon_create_for_wwindow(WWindow *wwin)
-- 
1.7.10.4


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.


Re: Help with Atom (window/icon titles)

2012-10-31 Thread Rodolfo García Peñas
On Thu, 01 Nov 2012, Rodolfo kix Garcia escribió:

 Hi,
 
 I need help with Atoms. Now the windows are using 
 wNETWMGetWindowName(Window*) to set the window title (see window.c), but 
 Icons are using wNETWMGetIconName(Window*) to set the icon title. Yes, icon 
 titles are different between the window and the icon.
 
 Running some applications, for example gitk, the window show title, but the 
 icon don't have title. We can use the same function in both icon and windows.
 
 The change is easy:
 
 129 #ifdef NO_MINIWINDOW_TITLES
 130 icon-show_title = 0;
 131 #else
 132 icon-show_title = 1;
 133 #endif
 134 
 135 //  icon-icon_name = wNETWMGetIconName(wwin-client_win);
 136 icon-icon_name = wNETWMGetWindowName(wwin-client_win);
 137 if (icon-icon_name)
 138 wwin-flags.net_has_icon_title = 1;
 139 else
 
 Commented line should be removed, line 136 is new. Lines may differ, because 
 I have more patches running here.
 
 The icons are now better, all with titles :-) The question is: Should we use 
 the window name in icons?

Perhaps, do something like use the icon name, but if it is NULL, use the 
window name?
 
 What should we do with this code (wmspec.c)
 
 1464 } else if (event-atom == net_wm_window_type) {
 1465 updateWindowType(wwin);
 1466 } else if (event-atom == net_wm_name) {
 1467*char *name = wNETWMGetWindowName(wwin-client_win);
 1468*wWindowUpdateName(wwin, name);
 1469 if (name)
 1470 wfree(name);
 1471 } else if (event-atom == net_wm_icon_name) {
 1472 if (wwin-icon) {
 1473*char *name = wNETWMGetIconName(wwin-client_win);
 1474*wIconChangeTitle(wwin-icon, name);
 1475 }
 
 See lines with *.
 
 Thanks,
 kix
 
 -- 
 ||// //\\// Rodolfo kix Garcia
 ||\\// //\\ http://www.kix.es/
 
 
 -- 
 To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

-- 
||// //\\// Rodolfo kix Garcia
||\\// //\\ http://www.kix.es/


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.