mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 21:08:08 +01:00
automatic hide language button if window is not focusable.
This commit is contained in:
@@ -1143,7 +1143,7 @@ wShowInfoPanel(WScreen *scr)
|
|||||||
WSETUFLAG(wwin, no_closable, 0);
|
WSETUFLAG(wwin, no_closable, 0);
|
||||||
WSETUFLAG(wwin, no_close_button, 0);
|
WSETUFLAG(wwin, no_close_button, 0);
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
wFrameWindowHideButton(wwin->frame, WFF_XKB_BUTTON);
|
wFrameWindowHideButton(wwin->frame, WFF_LANGUAGE_BUTTON);
|
||||||
#endif
|
#endif
|
||||||
wWindowUpdateButtonImages(wwin);
|
wWindowUpdateButtonImages(wwin);
|
||||||
wFrameWindowShowButton(wwin->frame, WFF_RIGHT_BUTTON);
|
wFrameWindowShowButton(wwin->frame, WFF_RIGHT_BUTTON);
|
||||||
@@ -1262,7 +1262,7 @@ wShowLegalPanel(WScreen *scr)
|
|||||||
wWindowUpdateButtonImages(wwin);
|
wWindowUpdateButtonImages(wwin);
|
||||||
wFrameWindowShowButton(wwin->frame, WFF_RIGHT_BUTTON);
|
wFrameWindowShowButton(wwin->frame, WFF_RIGHT_BUTTON);
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
wFrameWindowHideButton(wwin->frame, WFF_XKB_BUTTON);
|
wFrameWindowHideButton(wwin->frame, WFF_LANGUAGE_BUTTON);
|
||||||
#endif
|
#endif
|
||||||
wwin->frame->on_click_right = destroyLegalPanel;
|
wwin->frame->on_click_right = destroyLegalPanel;
|
||||||
|
|
||||||
@@ -1682,7 +1682,7 @@ wShowGNUstepPanel(WScreen *scr)
|
|||||||
wWindowUpdateButtonImages(wwin);
|
wWindowUpdateButtonImages(wwin);
|
||||||
wFrameWindowShowButton(wwin->frame, WFF_RIGHT_BUTTON);
|
wFrameWindowShowButton(wwin->frame, WFF_RIGHT_BUTTON);
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
wFrameWindowHideButton(wwin->frame, WFF_XKB_BUTTON);
|
wFrameWindowHideButton(wwin->frame, WFF_LANGUAGE_BUTTON);
|
||||||
#endif
|
#endif
|
||||||
wwin->frame->on_click_right = destroyGNUstepPanel;
|
wwin->frame->on_click_right = destroyGNUstepPanel;
|
||||||
|
|
||||||
|
|||||||
@@ -450,10 +450,8 @@ saveTimestamp(XEvent *event)
|
|||||||
static void
|
static void
|
||||||
handleExtensions(XEvent *event)
|
handleExtensions(XEvent *event)
|
||||||
{
|
{
|
||||||
#ifdef KEEP_XKB_LOCK_STATUS
|
|
||||||
XkbEvent *xkbevent;
|
XkbEvent *xkbevent;
|
||||||
xkbevent = (XkbEvent *)event;
|
xkbevent = (XkbEvent *)event;
|
||||||
#endif /*KEEP_XKB_LOCK_STATUS*/
|
|
||||||
#ifdef SHAPE
|
#ifdef SHAPE
|
||||||
if (wShapeSupported && event->type == (wShapeEventBase+ShapeNotify)) {
|
if (wShapeSupported && event->type == (wShapeEventBase+ShapeNotify)) {
|
||||||
handleShapeNotify(event);
|
handleShapeNotify(event);
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ wFrameWindowUpdateBorders(WFrameWindow *fwin, int flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
if (flags & WFF_XKB_BUTTON) {
|
if (flags & WFF_LANGUAGE_BUTTON) {
|
||||||
fwin->flags.language_button = 1;
|
fwin->flags.language_button = 1;
|
||||||
if (wPreferences.new_style) {
|
if (wPreferences.new_style) {
|
||||||
fwin->language_button = wCoreCreate(fwin->core,
|
fwin->language_button = wCoreCreate(fwin->core,
|
||||||
@@ -545,7 +545,7 @@ wFrameWindowHideButton(WFrameWindow *fwin, int flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
if ((flags & WFF_XKB_BUTTON) && fwin->language_button) {
|
if ((flags & WFF_LANGUAGE_BUTTON) && fwin->language_button) {
|
||||||
XUnmapWindow(dpy, fwin->language_button->window);
|
XUnmapWindow(dpy, fwin->language_button->window);
|
||||||
fwin->flags.hide_language_button = 1;
|
fwin->flags.hide_language_button = 1;
|
||||||
}
|
}
|
||||||
@@ -580,7 +580,7 @@ wFrameWindowShowButton(WFrameWindow *fwin, int flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
if ((flags & WFF_XKB_BUTTON) && fwin->language_button
|
if ((flags & WFF_LANGUAGE_BUTTON) && fwin->language_button
|
||||||
&& fwin->flags.hide_language_button) {
|
&& fwin->flags.hide_language_button) {
|
||||||
|
|
||||||
if (!fwin->flags.languagebutton_dont_fit)
|
if (!fwin->flags.languagebutton_dont_fit)
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
#define WFF_BORDER (1<<4)
|
#define WFF_BORDER (1<<4)
|
||||||
#define WFF_SINGLE_STATE (1<<5)
|
#define WFF_SINGLE_STATE (1<<5)
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
#define WFF_XKB_BUTTON (1<<6)
|
#define WFF_LANGUAGE_BUTTON (1<<6)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -127,6 +127,10 @@ Bool wShapeSupported;
|
|||||||
int wShapeEventBase;
|
int wShapeEventBase;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef KEEP_XKB_LOCK_STATUS
|
||||||
|
Bool wXkbSupported;
|
||||||
|
int wXkbEventBase;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* special flags */
|
/* special flags */
|
||||||
char WProgramState = WSTATE_NORMAL;
|
char WProgramState = WSTATE_NORMAL;
|
||||||
|
|||||||
@@ -97,6 +97,11 @@ extern Bool wShapeSupported;
|
|||||||
extern int wShapeEventBase;
|
extern int wShapeEventBase;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef KEEP_XKB_LOCK_STATUS
|
||||||
|
extern Bool wXkbSupported;
|
||||||
|
extern int wXkbEventBase;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* contexts */
|
/* contexts */
|
||||||
extern XContext wWinContext;
|
extern XContext wWinContext;
|
||||||
extern XContext wAppWinContext;
|
extern XContext wAppWinContext;
|
||||||
@@ -794,6 +799,14 @@ StartUp(Bool defaultScreenOnly)
|
|||||||
wShapeSupported = XShapeQueryExtension(dpy, &wShapeEventBase, &j);
|
wShapeSupported = XShapeQueryExtension(dpy, &wShapeEventBase, &j);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef KEEP_XKB_LOCK_STATUS
|
||||||
|
wXkbSupported = XkbQueryExtension(dpy, NULL, &wXkbEventBase, NULL, NULL, NULL);
|
||||||
|
if(wPreferences.modelock && !wXkbSupported) {
|
||||||
|
wwarning(_("XKB is not supported. KbdModeLock is automatically disabled."));
|
||||||
|
wPreferences.modelock = 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (defaultScreenOnly) {
|
if (defaultScreenOnly) {
|
||||||
max = 1;
|
max = 1;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -893,7 +893,7 @@ wManageWindow(WScreen *scr, Window window)
|
|||||||
foo = WFF_LEFT_BUTTON | WFF_RIGHT_BUTTON;
|
foo = WFF_LEFT_BUTTON | WFF_RIGHT_BUTTON;
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
if (wPreferences.modelock)
|
if (wPreferences.modelock)
|
||||||
foo |= WFF_XKB_BUTTON;
|
foo |= WFF_LANGUAGE_BUTTON;
|
||||||
#endif
|
#endif
|
||||||
if (!WFLAGP(wwin, no_titlebar))
|
if (!WFLAGP(wwin, no_titlebar))
|
||||||
foo |= WFF_TITLEBAR;
|
foo |= WFF_TITLEBAR;
|
||||||
@@ -920,6 +920,10 @@ wManageWindow(WScreen *scr, Window window)
|
|||||||
foo |= WFF_RIGHT_BUTTON;
|
foo |= WFF_RIGHT_BUTTON;
|
||||||
if (WFLAGP(wwin, no_miniaturize_button))
|
if (WFLAGP(wwin, no_miniaturize_button))
|
||||||
foo |= WFF_LEFT_BUTTON;
|
foo |= WFF_LEFT_BUTTON;
|
||||||
|
#ifdef XKB_BUTTON_HINT
|
||||||
|
if (WFLAGP(wwin, no_language_button) || WFLAGP(wwin, no_focusable))
|
||||||
|
foo |= WFF_LANGUAGE_BUTTON;
|
||||||
|
#endif
|
||||||
if (foo!=0)
|
if (foo!=0)
|
||||||
wFrameWindowHideButton(wwin->frame, foo);
|
wFrameWindowHideButton(wwin->frame, foo);
|
||||||
|
|
||||||
@@ -1254,7 +1258,7 @@ wManageInternalWindow(WScreen *scr, Window window, Window owner,
|
|||||||
foo = WFF_RIGHT_BUTTON;
|
foo = WFF_RIGHT_BUTTON;
|
||||||
foo |= WFF_TITLEBAR;
|
foo |= WFF_TITLEBAR;
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
foo |= WFF_XKB_BUTTON;
|
foo |= WFF_LANGUAGE_BUTTON;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wwin->frame = wFrameWindowCreate(scr, WMFloatingLevel,
|
wwin->frame = wFrameWindowCreate(scr, WMFloatingLevel,
|
||||||
|
|||||||
Reference in New Issue
Block a user