Re: [PATCH 1/2] Made highlighting the AppIcon of the active app configurable at run time
On Sat, 17 Nov 2012, BALATON Zoltan escribió: On Sat, 17 Nov 2012, Carlos R. Mafra wrote: I don't like having a configurable switch for trivial things like this. I guess that most users simply don't care about one way or another. High-level switches like having icons or not is what should be aimed for. Once you make a high-level choice, you basically get what you get. What basically means is not well-defined of course, but I think that this patch goes a bit beyond. There has to be some limit for pickiness. Hi, both are right. I think like Carlos, this is a trivial thing and we should have a limit. But, in this case the code was there. IMO I prefer always change things in runtime that change things in compiling time. I thing we have three options: 1. Don't do nothing, and continue with compiling time 2. Remove all code, because is trivial 3. Apply the patch and continue with this functionality in running time. Therefore, IMHO, in this case, option 3 and +1 for upload the patch. Regards, kix I don't understand what you don't like about this patch since this is not even adding a new option. This option has always been there in wconfig.h (as NEWAPPICON) but there was no way to change it at runtime. My patch simply makes it runtime configurable and adds an option to the expert panel which already has switches for things like using save under or not or having selection animation of icons. This option is not more picky than those. Moreover I took care not to change the default behaviour either so most users don't have to care about it at all and this also removes a #define and corresponding #ifdefs so it can count as a cleanup. Having this option configurable only at compile time has been a reason for me to always have to compile my own version of Window Maker instead of being able to use the package that comes with the distribution. I can continue compiling my own version of course (looking at flashing and washed out icons is not an option for me) but merging this patch would make at least one of your user's life easier without doing anyone else any harm so I don't see why you would not take it. Of course it's your decision as a maintainer but you could reconsider it. Regards, BALATON Zoltan -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org. -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 1/2] Made highlighting the AppIcon of the active app configurable at run time
--- WPrefs.app/Expert.c | 14 +- src/WindowMaker.h |6 +++--- src/actions.c |8 +--- src/appicon.c |2 ++ src/application.c |5 - src/defaults.c |2 ++ src/icon.c |2 -- src/icon.h |3 +-- src/wconfig.h.in|3 --- src/window.c|3 ++- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/WPrefs.app/Expert.c b/WPrefs.app/Expert.c index f897384..177bbd8 100644 --- a/WPrefs.app/Expert.c +++ b/WPrefs.app/Expert.c @@ -22,9 +22,9 @@ #include WPrefs.h #ifdef XKB_MODELOCK -#define NUMITEMS 10 +#define NUMITEMS 11 #else -#define NUMITEMS 9 +#define NUMITEMS 10 #endif typedef struct _Panel { @@ -56,8 +56,9 @@ static void showData(_Panel * panel) WMSetButtonSelected(panel-swi[6], GetBoolForKey(AntialiasedText)); WMSetButtonSelected(panel-swi[7], GetBoolForKey(CycleActiveHeadOnly)); WMSetButtonSelected(panel-swi[8], GetBoolForKey(ShowClipTitle)); + WMSetButtonSelected(panel-swi[9], GetBoolForKey(HighlightActiveApp)); #ifdef XKB_MODELOCK - WMSetButtonSelected(panel-swi[9], GetBoolForKey(KbdModeLock)); + WMSetButtonSelected(panel-swi[10], GetBoolForKey(KbdModeLock)); #endif /* XKB_MODELOCK */ } @@ -98,13 +99,15 @@ static void createPanel(Panel * p) WMSetButtonText(panel-swi[6], _(Smooth font edges (needs restart).)); WMSetButtonText(panel-swi[7], _(Cycle windows only on the active head.)); WMSetButtonText(panel-swi[8], _(Show workspace title on Clip.)); + WMSetButtonText(panel-swi[9], _(Highlight the icon of the application when it has the focus.)); #ifdef XKB_MODELOCK - WMSetButtonText(panel-swi[9], _(Enable keyboard language switch button in window titlebars.)); + WMSetButtonText(panel-swi[10], _(Enable keyboard language switch button in window titlebars.)); #endif /* XKB_MODELOCK */ /* If the item is default true, enable the button here */ WMSetButtonEnabled(panel-swi[6], True); WMSetButtonEnabled(panel-swi[8], True); + WMSetButtonEnabled(panel-swi[9], True); WMMapSubwidgets(panel-box); WMSetScrollViewContentView(sv, WMWidgetView(f)); @@ -128,8 +131,9 @@ static void storeDefaults(_Panel * panel) SetBoolForKey(WMGetButtonSelected(panel-swi[6]), AntialiasedText); SetBoolForKey(WMGetButtonSelected(panel-swi[7]), CycleActiveHeadOnly); SetBoolForKey(WMGetButtonSelected(panel-swi[8]), ShowClipTitle); + SetBoolForKey(WMGetButtonSelected(panel-swi[9]), HighlightActiveApp); #ifdef XKB_MODELOCK - SetBoolForKey(WMGetButtonSelected(panel-swi[9]), KbdModeLock); + SetBoolForKey(WMGetButtonSelected(panel-swi[10]), KbdModeLock); #endif /* XKB_MODELOCK */ } diff --git a/src/WindowMaker.h b/src/WindowMaker.h index 804695b..ca89299 100644 --- a/src/WindowMaker.h +++ b/src/WindowMaker.h @@ -351,12 +351,12 @@ typedef struct WPreferences { #endif char no_dithering;/* use dithering or not */ char no_animations; /* enable/disable animations */ -char no_autowrap; /* wrap workspace when window is moved -* to the edge */ +char no_autowrap; /* wrap workspace when window is moved to the edge */ +char highlight_active_app; /* show the focused app by highlighting its icon */ char auto_arrange_icons; /* automagically arrange icons */ char icon_box_position; /* position to place icons */ -signed char iconification_style; /* position to place icons */ +signed char iconification_style; /* position to place icons */ char disable_root_mouse; /* disable button events in root window */ char auto_focus; /* focus window when it's mapped */ char *icon_back_file; /* background image for icons */ diff --git a/src/actions.c b/src/actions.c index 7dceaff..a79de8a 100644 --- a/src/actions.c +++ b/src/actions.c @@ -136,7 +136,8 @@ void wSetFocusTo(WScreen *scr, WWindow *wwin) if (oapp) { wAppMenuUnmap(oapp-menu); - wApplicationDeactivate(oapp); + if (wPreferences.highlight_active_app) + wApplicationDeactivate(oapp); } WMPostNotificationName(WMNChangedFocus, NULL, (void *)True); @@ -199,7 +200,8 @@ void wSetFocusTo(WScreen *scr, WWindow *wwin) if (oapp oapp != napp) { wAppMenuUnmap(oapp-menu); - wApplicationDeactivate(oapp); + if (wPreferences.highlight_active_app) + wApplicationDeactivate(oapp); } } @@ -213,7 +215,7 @@ void wSetFocusTo(WScreen *scr, WWindow *wwin) if (wwin-flags.mapped) wAppMenuMap(napp-menu,
Re: [PATCH 1/2] Made highlighting the AppIcon of the active app configurable at run time
On Fri, 16 Nov 2012 at 21:53:57 +0100, BALATON Zoltan wrote: + WMSetButtonText(panel-swi[9], _(Highlight the icon of the application when it has the focus.)); I don't like having a configurable switch for trivial things like this. I guess that most users simply don't care about one way or another. High-level switches like having icons or not is what should be aimed for. Once you make a high-level choice, you basically get what you get. What basically means is not well-defined of course, but I think that this patch goes a bit beyond. There has to be some limit for pickiness. -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
Re: [PATCH 1/2] Made highlighting the AppIcon of the active app configurable at run time
On Sat, 17 Nov 2012, Carlos R. Mafra wrote: I don't like having a configurable switch for trivial things like this. I guess that most users simply don't care about one way or another. High-level switches like having icons or not is what should be aimed for. Once you make a high-level choice, you basically get what you get. What basically means is not well-defined of course, but I think that this patch goes a bit beyond. There has to be some limit for pickiness. I don't understand what you don't like about this patch since this is not even adding a new option. This option has always been there in wconfig.h (as NEWAPPICON) but there was no way to change it at runtime. My patch simply makes it runtime configurable and adds an option to the expert panel which already has switches for things like using save under or not or having selection animation of icons. This option is not more picky than those. Moreover I took care not to change the default behaviour either so most users don't have to care about it at all and this also removes a #define and corresponding #ifdefs so it can count as a cleanup. Having this option configurable only at compile time has been a reason for me to always have to compile my own version of Window Maker instead of being able to use the package that comes with the distribution. I can continue compiling my own version of course (looking at flashing and washed out icons is not an option for me) but merging this patch would make at least one of your user's life easier without doing anyone else any harm so I don't see why you would not take it. Of course it's your decision as a maintainer but you could reconsider it. Regards, BALATON Zoltan -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.