mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +01:00
Made highlighting the AppIcon of the active app configurable at run time
This commit is contained in:
committed by
Carlos R. Mafra
parent
df601267e6
commit
c7e3666e62
@@ -22,9 +22,9 @@
|
|||||||
#include "WPrefs.h"
|
#include "WPrefs.h"
|
||||||
|
|
||||||
#ifdef XKB_MODELOCK
|
#ifdef XKB_MODELOCK
|
||||||
#define NUMITEMS 10
|
#define NUMITEMS 11
|
||||||
#else
|
#else
|
||||||
#define NUMITEMS 9
|
#define NUMITEMS 10
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct _Panel {
|
typedef struct _Panel {
|
||||||
@@ -56,8 +56,9 @@ static void showData(_Panel * panel)
|
|||||||
WMSetButtonSelected(panel->swi[6], GetBoolForKey("AntialiasedText"));
|
WMSetButtonSelected(panel->swi[6], GetBoolForKey("AntialiasedText"));
|
||||||
WMSetButtonSelected(panel->swi[7], GetBoolForKey("CycleActiveHeadOnly"));
|
WMSetButtonSelected(panel->swi[7], GetBoolForKey("CycleActiveHeadOnly"));
|
||||||
WMSetButtonSelected(panel->swi[8], GetBoolForKey("ShowClipTitle"));
|
WMSetButtonSelected(panel->swi[8], GetBoolForKey("ShowClipTitle"));
|
||||||
|
WMSetButtonSelected(panel->swi[9], GetBoolForKey("HighlightActiveApp"));
|
||||||
#ifdef XKB_MODELOCK
|
#ifdef XKB_MODELOCK
|
||||||
WMSetButtonSelected(panel->swi[9], GetBoolForKey("KbdModeLock"));
|
WMSetButtonSelected(panel->swi[10], GetBoolForKey("KbdModeLock"));
|
||||||
#endif /* XKB_MODELOCK */
|
#endif /* XKB_MODELOCK */
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,13 +99,15 @@ static void createPanel(Panel * p)
|
|||||||
WMSetButtonText(panel->swi[6], _("Smooth font edges (needs restart)."));
|
WMSetButtonText(panel->swi[6], _("Smooth font edges (needs restart)."));
|
||||||
WMSetButtonText(panel->swi[7], _("Cycle windows only on the active head."));
|
WMSetButtonText(panel->swi[7], _("Cycle windows only on the active head."));
|
||||||
WMSetButtonText(panel->swi[8], _("Show workspace title on Clip."));
|
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
|
#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 */
|
#endif /* XKB_MODELOCK */
|
||||||
|
|
||||||
/* If the item is default true, enable the button here */
|
/* If the item is default true, enable the button here */
|
||||||
WMSetButtonEnabled(panel->swi[6], True);
|
WMSetButtonEnabled(panel->swi[6], True);
|
||||||
WMSetButtonEnabled(panel->swi[8], True);
|
WMSetButtonEnabled(panel->swi[8], True);
|
||||||
|
WMSetButtonEnabled(panel->swi[9], True);
|
||||||
|
|
||||||
WMMapSubwidgets(panel->box);
|
WMMapSubwidgets(panel->box);
|
||||||
WMSetScrollViewContentView(sv, WMWidgetView(f));
|
WMSetScrollViewContentView(sv, WMWidgetView(f));
|
||||||
@@ -128,8 +131,9 @@ static void storeDefaults(_Panel * panel)
|
|||||||
SetBoolForKey(WMGetButtonSelected(panel->swi[6]), "AntialiasedText");
|
SetBoolForKey(WMGetButtonSelected(panel->swi[6]), "AntialiasedText");
|
||||||
SetBoolForKey(WMGetButtonSelected(panel->swi[7]), "CycleActiveHeadOnly");
|
SetBoolForKey(WMGetButtonSelected(panel->swi[7]), "CycleActiveHeadOnly");
|
||||||
SetBoolForKey(WMGetButtonSelected(panel->swi[8]), "ShowClipTitle");
|
SetBoolForKey(WMGetButtonSelected(panel->swi[8]), "ShowClipTitle");
|
||||||
|
SetBoolForKey(WMGetButtonSelected(panel->swi[9]), "HighlightActiveApp");
|
||||||
#ifdef XKB_MODELOCK
|
#ifdef XKB_MODELOCK
|
||||||
SetBoolForKey(WMGetButtonSelected(panel->swi[9]), "KbdModeLock");
|
SetBoolForKey(WMGetButtonSelected(panel->swi[10]), "KbdModeLock");
|
||||||
#endif /* XKB_MODELOCK */
|
#endif /* XKB_MODELOCK */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -351,12 +351,12 @@ typedef struct WPreferences {
|
|||||||
#endif
|
#endif
|
||||||
char no_dithering; /* use dithering or not */
|
char no_dithering; /* use dithering or not */
|
||||||
char no_animations; /* enable/disable animations */
|
char no_animations; /* enable/disable animations */
|
||||||
char no_autowrap; /* wrap workspace when window is moved
|
char no_autowrap; /* wrap workspace when window is moved to the edge */
|
||||||
* to the edge */
|
|
||||||
|
|
||||||
|
char highlight_active_app; /* show the focused app by highlighting its icon */
|
||||||
char auto_arrange_icons; /* automagically arrange icons */
|
char auto_arrange_icons; /* automagically arrange icons */
|
||||||
char icon_box_position; /* position to place 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 disable_root_mouse; /* disable button events in root window */
|
||||||
char auto_focus; /* focus window when it's mapped */
|
char auto_focus; /* focus window when it's mapped */
|
||||||
char *icon_back_file; /* background image for icons */
|
char *icon_back_file; /* background image for icons */
|
||||||
|
|||||||
@@ -136,7 +136,8 @@ void wSetFocusTo(WScreen *scr, WWindow *wwin)
|
|||||||
|
|
||||||
if (oapp) {
|
if (oapp) {
|
||||||
wAppMenuUnmap(oapp->menu);
|
wAppMenuUnmap(oapp->menu);
|
||||||
wApplicationDeactivate(oapp);
|
if (wPreferences.highlight_active_app)
|
||||||
|
wApplicationDeactivate(oapp);
|
||||||
}
|
}
|
||||||
|
|
||||||
WMPostNotificationName(WMNChangedFocus, NULL, (void *)True);
|
WMPostNotificationName(WMNChangedFocus, NULL, (void *)True);
|
||||||
@@ -199,7 +200,8 @@ void wSetFocusTo(WScreen *scr, WWindow *wwin)
|
|||||||
|
|
||||||
if (oapp && oapp != napp) {
|
if (oapp && oapp != napp) {
|
||||||
wAppMenuUnmap(oapp->menu);
|
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)
|
if (wwin->flags.mapped)
|
||||||
wAppMenuMap(napp->menu, wwin);
|
wAppMenuMap(napp->menu, wwin);
|
||||||
}
|
}
|
||||||
if (napp)
|
if (napp && wPreferences.highlight_active_app)
|
||||||
wApplicationActivate(napp);
|
wApplicationActivate(napp);
|
||||||
|
|
||||||
XFlush(dpy);
|
XFlush(dpy);
|
||||||
|
|||||||
@@ -243,6 +243,8 @@ void removeAppIconFor(WApplication *wapp)
|
|||||||
if (!wapp->app_icon)
|
if (!wapp->app_icon)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (wPreferences.highlight_active_app)
|
||||||
|
wIconSetHighlited(wapp->app_icon->icon, False);
|
||||||
if (wapp->app_icon->docked && !wapp->app_icon->attracted) {
|
if (wapp->app_icon->docked && !wapp->app_icon->attracted) {
|
||||||
wapp->app_icon->running = 0;
|
wapp->app_icon->running = 0;
|
||||||
/* since we keep it, we don't care if it was attracted or not */
|
/* since we keep it, we don't care if it was attracted or not */
|
||||||
|
|||||||
@@ -194,7 +194,6 @@ void wApplicationDestroy(WApplication * wapp)
|
|||||||
|
|
||||||
XDeleteContext(dpy, wapp->main_window, wAppWinContext);
|
XDeleteContext(dpy, wapp->main_window, wAppWinContext);
|
||||||
wAppMenuDestroy(wapp->menu);
|
wAppMenuDestroy(wapp->menu);
|
||||||
wApplicationDeactivate(wapp);
|
|
||||||
|
|
||||||
/* Remove application icon */
|
/* Remove application icon */
|
||||||
removeAppIconFor(wapp);
|
removeAppIconFor(wapp);
|
||||||
@@ -212,20 +211,16 @@ void wApplicationDestroy(WApplication * wapp)
|
|||||||
|
|
||||||
void wApplicationActivate(WApplication *wapp)
|
void wApplicationActivate(WApplication *wapp)
|
||||||
{
|
{
|
||||||
#ifdef NEWAPPICON
|
|
||||||
if (wapp->app_icon) {
|
if (wapp->app_icon) {
|
||||||
wIconSetHighlited(wapp->app_icon->icon, True);
|
wIconSetHighlited(wapp->app_icon->icon, True);
|
||||||
wAppIconPaint(wapp->app_icon);
|
wAppIconPaint(wapp->app_icon);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wApplicationDeactivate(WApplication *wapp)
|
void wApplicationDeactivate(WApplication *wapp)
|
||||||
{
|
{
|
||||||
#ifdef NEWAPPICON
|
|
||||||
if (wapp->app_icon) {
|
if (wapp->app_icon) {
|
||||||
wIconSetHighlited(wapp->app_icon->icon, False);
|
wIconSetHighlited(wapp->app_icon->icon, False);
|
||||||
wAppIconPaint(wapp->app_icon);
|
wAppIconPaint(wapp->app_icon);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -416,6 +416,8 @@ WDefaultEntry optionList[] = {
|
|||||||
&wPreferences.no_animations, getBool, NULL, NULL, NULL},
|
&wPreferences.no_animations, getBool, NULL, NULL, NULL},
|
||||||
{"DontLinkWorkspaces", "NO", NULL,
|
{"DontLinkWorkspaces", "NO", NULL,
|
||||||
&wPreferences.no_autowrap, getBool, NULL, NULL, NULL},
|
&wPreferences.no_autowrap, getBool, NULL, NULL, NULL},
|
||||||
|
{"HighlightActiveApp", "YES", NULL,
|
||||||
|
&wPreferences.highlight_active_app, getBool, NULL, NULL, NULL},
|
||||||
{"AutoArrangeIcons", "NO", NULL,
|
{"AutoArrangeIcons", "NO", NULL,
|
||||||
&wPreferences.auto_arrange_icons, getBool, NULL, NULL, NULL},
|
&wPreferences.auto_arrange_icons, getBool, NULL, NULL, NULL},
|
||||||
{"NoWindowOverDock", "NO", NULL,
|
{"NoWindowOverDock", "NO", NULL,
|
||||||
|
|||||||
@@ -554,7 +554,6 @@ static void cycleColor(void *data)
|
|||||||
icon->handlerID = WMAddTimerHandler(COLOR_CYCLE_DELAY, cycleColor, icon);
|
icon->handlerID = WMAddTimerHandler(COLOR_CYCLE_DELAY, cycleColor, icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef NEWAPPICON
|
|
||||||
void wIconSetHighlited(WIcon *icon, Bool flag)
|
void wIconSetHighlited(WIcon *icon, Bool flag)
|
||||||
{
|
{
|
||||||
if (icon->highlighted == flag)
|
if (icon->highlighted == flag)
|
||||||
@@ -563,7 +562,6 @@ void wIconSetHighlited(WIcon *icon, Bool flag)
|
|||||||
icon->highlighted = flag;
|
icon->highlighted = flag;
|
||||||
update_icon_pixmap(icon);
|
update_icon_pixmap(icon);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void wIconSelect(WIcon * icon)
|
void wIconSelect(WIcon * icon)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -70,7 +70,6 @@ RImage *wIconValidateIconSize(RImage *icon, int max_size);
|
|||||||
char *wIconStore(WIcon *icon);
|
char *wIconStore(WIcon *icon);
|
||||||
char *get_name_for_instance_class(char *wm_instance, char *wm_class);
|
char *get_name_for_instance_class(char *wm_instance, char *wm_class);
|
||||||
|
|
||||||
#ifdef NEWAPPICON
|
|
||||||
void wIconSetHighlited(WIcon *icon, Bool flag);
|
void wIconSetHighlited(WIcon *icon, Bool flag);
|
||||||
#endif /* NEWAPPICON */
|
|
||||||
#endif /* WMICON_H_ */
|
#endif /* WMICON_H_ */
|
||||||
|
|||||||
@@ -35,9 +35,6 @@
|
|||||||
/* If you want animations for iconification, shading, icon arrangement etc. */
|
/* If you want animations for iconification, shading, icon arrangement etc. */
|
||||||
#define ANIMATIONS
|
#define ANIMATIONS
|
||||||
|
|
||||||
/* If you want the application icon to be highlighted when it has the focus */
|
|
||||||
#define NEWAPPICON
|
|
||||||
|
|
||||||
/* support for XDND drop in the Dock. Experimental */
|
/* support for XDND drop in the Dock. Experimental */
|
||||||
/*#define XDND*/
|
/*#define XDND*/
|
||||||
|
|
||||||
|
|||||||
@@ -1658,7 +1658,8 @@ void wUnmanageWindow(WWindow *wwin, Bool restore, Bool destroyed)
|
|||||||
WApplication *napp = scr->focused_window ? wApplicationOf(scr->focused_window->main_window) : NULL;
|
WApplication *napp = scr->focused_window ? wApplicationOf(scr->focused_window->main_window) : NULL;
|
||||||
if (oapp && oapp != napp) {
|
if (oapp && oapp != napp) {
|
||||||
wAppMenuUnmap(oapp->menu);
|
wAppMenuUnmap(oapp->menu);
|
||||||
wApplicationDeactivate(oapp);
|
if (wPreferences.highlight_active_app)
|
||||||
|
wApplicationDeactivate(oapp);
|
||||||
}
|
}
|
||||||
|
|
||||||
wNETCleanupFrameExtents(wwin);
|
wNETCleanupFrameExtents(wwin);
|
||||||
|
|||||||
Reference in New Issue
Block a user