Re: [PATCH 1/3] Added option to ignore minimized windows during cycling.

2012-11-27 Thread Martin Frydl
On Mon, Nov 26, 2012 at 11:50 PM, Carlos R. Mafra  wrote:
> On Mon, 26 Nov 2012 at 19:12:26 +0100, Martin Frydl wrote:
>> Added CycleIgnoresMinimized configuration option settable on Expert page in 
>> WPrefs.
>> When option is set, switch panel cycling ignores minimized (grayed) windows. 
>> They
>> are still visible and can be selected using left/right arrows or mouse click.
>
> I'm not sure if I like this option, but a couple of trivial comments
> are below. First, you should base your patches on the #next branch
> as Christophe already pointed out.

Unfortunately, I've missed this information. I have 0.95..3 version
from Fedora 17 and I've checked out what was written in
The-perfect-Window-Maker-patch.txt. I should have looked at the
website.

>> + WMSetButtonSelected(panel->swi[14], 
>> GetBoolForKey("CycleIgnoresMinimized"));
>
> Use CycleIgnoreMinimized instead, since this is more like an imperative.

OK

>> -WWindow *wSwitchPanelSelectNext(WSwitchPanel *panel, int back)
>> +WWindow *wSwitchPanelSelectNext(WSwitchPanel *panel, int back, int 
>> ignoreMini)
>
> ignoreMini is not a good name. Something like ignore_minimized is better.

OK

>> - if (back)
>> - panel->current--;
>> - else
>> - panel->current++;
>> + if (!wPreferences.cycle_ignores_minimized) ignoreMini = False;
>
> Please do not use this coding style, wmaker-crm uses the linux kernel
> coding style instead, see http://windowmaker.org/dev.php

OK.

> Apart from that, is it really necessary to change the code to use
> the "do while" loop in order to add your option? If that's not the
> case, you should write another patch to use the do while loop.

I'm sorry I do not understand. What do you mean by not using '"do
while" loop' and at the same time 'another patch to use the do while
loop'. I need a loop to skip all the minimized windows and find the
next "normal" one.

I've attached a new version of the patch.

Also, please ignore my remaining two patches as they are not needed in
#next branch.

Martin


0001-Added-option-to-ignore-minimized-windows-during-cycl.patch
Description: Binary data


Re: Problem with xfig

2012-11-27 Thread kix

On 2012-11-26 11:10, BALATON Zoltan wrote:

On Mon, 26 Nov 2012, Rodolfo García Peñas wrote:

No, is not fixed and I don't know how to fix it.


What is not fixed? Could you make a list of problems that are still
there and those that are already fixed. After all those patches 
you've

sent I'm not sure what was fixed and what's still there. I reported
these problems:

- minimising and restoring window results in X error RenderBadPicture
  (maybe only if the Render extension is enabled)
- ignore client supplied icon is not respected for some applications
  (e.g. xfig)
- Apply button in window inspector did nothing


Hi!

did you try the current "next" branch? This problem is not fully 
solved, but I think the button does things.


Thanks.


I also reported clipped icons if they were too big but that's fixed
(and drifting windows of apps which try to restore their position 
that

I hope Iain is looking at but not fixed yet).

Is only that these lines I commented, are the difference between 
icon and not icon, but I don't know how they impact in the code.


I could not parse this sentence. Can you explain?

Regards,
BALATON Zoltan


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


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


Re: Problem with xfig

2012-11-27 Thread BALATON Zoltan

On Tue, 27 Nov 2012, Rodolfo García Peñas (kix) wrote:
did you try the current "next" branch? This problem is not fully solved, but 
I think the button does things.


I'm running the next branch and it's not working correctly. Here's what I 
see:


1. Start xcalc and open Icon and Initial Workspace inspector you probably 
will see the icon pointing to a file in the cache and the Ignore client 
supplied icon option ticked


2. Delete the file name from the text field and untick the Ignore option 
then click save and check that there is no section now for XCalc in 
WMWindowAttributes. This should be the initial state when an application 
is first run. Now you can continue testing.


3. Close xcalc then start it again and see what happened in the inspector. 
Also check what's in WMWindowAttributes and note that the Ignore attribute 
is not consistent. (It is checked in the GUI but not set in the config.) 
All this should not happen as the cached image should not be added to the 
config file at the first place but let's continue testing.


4. Uncheck the Ignore option in the inspector and try to select an icon 
then click apply. See that nothing happens.


5. Click save, the icon has changed now in the appicon and also set in the 
config file but try to minimise the window and see that the miniwindow 
does not have the correct icon.


6. Now just close the app and restart it. Try minimising the window and 
the icon is now also set in the miniwindow. Check the inspector and see 
that the Ignore option is magically ticked now while it's still not set in 
WMWindowAttributes.


I think there are still some things left to fix to untangle this mess as 
this cannot be the correct behaviour. Most of this seems to be some 
breakage of the Ignore client supplied icon option.


Regards,
BALATON Zoltan

[repo.or.cz] wmaker-crm.git branch next updated: wmaker-0.95.3-212-gbf2f942

2012-11-27 Thread crmafra
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  bf2f9421388a56f804b7912de137fb12d062f106 (commit)
   via  914d4e06effcc78df4ffcf92175d51e4af45ff75 (commit)
  from  eae7ef6c596f0a8db8000d4590e367b88ba9dbbb (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/bf2f9421388a56f804b7912de137fb12d062f106

commit bf2f9421388a56f804b7912de137fb12d062f106
Author: Rodolfo García Peñas (kix) 
Date:   Thu Nov 22 22:40:12 2012 +0100

Avoid crash on icon move without command

This patch avoid a crash when moving an icon without command.
To reproduce the problem:

1. Launch an application, for example xeyes, with appicon.
2. Move the appicon to the clip.
3. Close the application.
4. Edit the appicon in the clip, and empty the commands fields.
5. Move the appicon from the clip to the dock. -> Crash.

The crash happends because icon->icon->owner is NULL and then
wwin will be NULL. Then the call of wwin->client_win will crash.

This patch checks if icon->icon->owner is not null (application is
running) and then assign it to wwin. Then get the command from the
running application.

diff --git a/src/dock.c b/src/dock.c
index 6e2e0e3..21d6aee 100644
--- a/src/dock.c
+++ b/src/dock.c
@@ -1855,18 +1855,21 @@ Bool wDockAttachIcon(WDock *dock, WAppIcon *icon, int 
x, int y, Bool update_icon
 {
WWindow *wwin;
Bool lupdate_icon = False;
+   char *command = NULL;
int index;
 
-   wwin = icon->icon->owner;
icon->editing = 0;
 
if (update_icon)
lupdate_icon = True;
 
if (icon->command == NULL) {
-   char *command;
+   /* If icon->owner exists, it means the application is running */
+   if (icon->icon->owner) {
+   wwin = icon->icon->owner;
+   command = GetCommandForWindow(wwin->client_win);
+   }
 
-   command = GetCommandForWindow(wwin->client_win);
if (command) {
icon->command = command;
} else {
@@ -1986,7 +1989,7 @@ static void reattachIcon(WDock *dock, WAppIcon *icon, int 
x, int y)
 static Bool moveIconBetweenDocks(WDock *src, WDock *dest, WAppIcon *icon, int 
x, int y)
 {
WWindow *wwin;
-   char *command;
+   char *command = NULL;
int index;
Bool update_icon = False;
 
@@ -1996,8 +1999,6 @@ static Bool moveIconBetweenDocks(WDock *src, WDock *dest, 
WAppIcon *icon, int x,
if (dest == NULL)
return False;
 
-   wwin = icon->icon->owner;
-
/*
 * For the moment we can't do this if we move icons in Clip from one
 * workspace to other, because if we move two or more icons without
@@ -2005,7 +2006,12 @@ static Bool moveIconBetweenDocks(WDock *src, WDock 
*dest, WAppIcon *icon, int x,
 * moved icons it applies. -Dan
 */
if ((dest->type == WM_DOCK /*|| dest->keep_attracted */ ) && 
icon->command == NULL) {
-   command = GetCommandForWindow(wwin->client_win);
+   /* If icon->owner exists, it means the application is running */
+   if (icon->icon->owner) {
+   wwin = icon->icon->owner;
+   command = GetCommandForWindow(wwin->client_win);
+   }
+
if (command) {
icon->command = command;
} else {

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

commit 914d4e06effcc78df4ffcf92175d51e4af45ff75
Author: Martin Frydl 
Date:   Tue Nov 27 11:13:34 2012 +0100

Added option to ignore minimized windows during cycling.

Added CycleIgnoreMinimized configuration option settable on Expert page in 
WPrefs.
When option is set, switch panel cycling ignores minimized (grayed) 
windows. They
are still visible and can be selected using left/right arrows or mouse 
click.

diff --git a/WPrefs.app/Expert.c b/WPrefs.app/Expert.c
index c6ecefd..d82bc6f 100644
--- a/WPrefs.app/Expert.c
+++ b/WPrefs.app/Expert.c
@@ -62,6 +62,9 @@ static const struct {
{ N_("Cycle windows only on the active head."),
  /* default: */ False, OPTION_WMAKER, "CycleActiveHeadOnly" },
 
+   { N_("Ignore minimized windows when cycling."),
+ /* default: */ False, OPTION_WMAKER, "CycleIgnoreMinimized" },
+
{ N_("Show workspace title on Clip."),
  /* default: */ True, OPTION_WMAKER, "ShowClipTitle" },
 
diff --git a/src/WindowMaker.h b/src/WindowMaker.h
index a