1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-20 12:58:08 +01:00

automatic hide language button if window is not focusable.

This commit is contained in:
id
1999-05-23 23:48:08 +00:00
parent 66eeb83d05
commit daaccf6fc9
7 changed files with 30 additions and 11 deletions

View File

@@ -1143,7 +1143,7 @@ wShowInfoPanel(WScreen *scr)
WSETUFLAG(wwin, no_closable, 0);
WSETUFLAG(wwin, no_close_button, 0);
#ifdef XKB_BUTTON_HINT
wFrameWindowHideButton(wwin->frame, WFF_XKB_BUTTON);
wFrameWindowHideButton(wwin->frame, WFF_LANGUAGE_BUTTON);
#endif
wWindowUpdateButtonImages(wwin);
wFrameWindowShowButton(wwin->frame, WFF_RIGHT_BUTTON);
@@ -1262,7 +1262,7 @@ wShowLegalPanel(WScreen *scr)
wWindowUpdateButtonImages(wwin);
wFrameWindowShowButton(wwin->frame, WFF_RIGHT_BUTTON);
#ifdef XKB_BUTTON_HINT
wFrameWindowHideButton(wwin->frame, WFF_XKB_BUTTON);
wFrameWindowHideButton(wwin->frame, WFF_LANGUAGE_BUTTON);
#endif
wwin->frame->on_click_right = destroyLegalPanel;
@@ -1682,7 +1682,7 @@ wShowGNUstepPanel(WScreen *scr)
wWindowUpdateButtonImages(wwin);
wFrameWindowShowButton(wwin->frame, WFF_RIGHT_BUTTON);
#ifdef XKB_BUTTON_HINT
wFrameWindowHideButton(wwin->frame, WFF_XKB_BUTTON);
wFrameWindowHideButton(wwin->frame, WFF_LANGUAGE_BUTTON);
#endif
wwin->frame->on_click_right = destroyGNUstepPanel;

View File

@@ -450,10 +450,8 @@ saveTimestamp(XEvent *event)
static void
handleExtensions(XEvent *event)
{
#ifdef KEEP_XKB_LOCK_STATUS
XkbEvent *xkbevent;
xkbevent = (XkbEvent *)event;
#endif /*KEEP_XKB_LOCK_STATUS*/
#ifdef SHAPE
if (wShapeSupported && event->type == (wShapeEventBase+ShapeNotify)) {
handleShapeNotify(event);

View File

@@ -253,7 +253,7 @@ wFrameWindowUpdateBorders(WFrameWindow *fwin, int flags)
}
#ifdef XKB_BUTTON_HINT
if (flags & WFF_XKB_BUTTON) {
if (flags & WFF_LANGUAGE_BUTTON) {
fwin->flags.language_button = 1;
if (wPreferences.new_style) {
fwin->language_button = wCoreCreate(fwin->core,
@@ -545,7 +545,7 @@ wFrameWindowHideButton(WFrameWindow *fwin, int flags)
}
#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);
fwin->flags.hide_language_button = 1;
}
@@ -580,7 +580,7 @@ wFrameWindowShowButton(WFrameWindow *fwin, int flags)
}
#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) {
if (!fwin->flags.languagebutton_dont_fit)

View File

@@ -37,7 +37,7 @@
#define WFF_BORDER (1<<4)
#define WFF_SINGLE_STATE (1<<5)
#ifdef XKB_BUTTON_HINT
#define WFF_XKB_BUTTON (1<<6)
#define WFF_LANGUAGE_BUTTON (1<<6)
#endif

View File

@@ -127,6 +127,10 @@ Bool wShapeSupported;
int wShapeEventBase;
#endif
#ifdef KEEP_XKB_LOCK_STATUS
Bool wXkbSupported;
int wXkbEventBase;
#endif
/* special flags */
char WProgramState = WSTATE_NORMAL;

View File

@@ -97,6 +97,11 @@ extern Bool wShapeSupported;
extern int wShapeEventBase;
#endif
#ifdef KEEP_XKB_LOCK_STATUS
extern Bool wXkbSupported;
extern int wXkbEventBase;
#endif
/* contexts */
extern XContext wWinContext;
extern XContext wAppWinContext;
@@ -794,6 +799,14 @@ StartUp(Bool defaultScreenOnly)
wShapeSupported = XShapeQueryExtension(dpy, &wShapeEventBase, &j);
#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) {
max = 1;
} else {

View File

@@ -893,7 +893,7 @@ wManageWindow(WScreen *scr, Window window)
foo = WFF_LEFT_BUTTON | WFF_RIGHT_BUTTON;
#ifdef XKB_BUTTON_HINT
if (wPreferences.modelock)
foo |= WFF_XKB_BUTTON;
foo |= WFF_LANGUAGE_BUTTON;
#endif
if (!WFLAGP(wwin, no_titlebar))
foo |= WFF_TITLEBAR;
@@ -920,6 +920,10 @@ wManageWindow(WScreen *scr, Window window)
foo |= WFF_RIGHT_BUTTON;
if (WFLAGP(wwin, no_miniaturize_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)
wFrameWindowHideButton(wwin->frame, foo);
@@ -1254,7 +1258,7 @@ wManageInternalWindow(WScreen *scr, Window window, Window owner,
foo = WFF_RIGHT_BUTTON;
foo |= WFF_TITLEBAR;
#ifdef XKB_BUTTON_HINT
foo |= WFF_XKB_BUTTON;
foo |= WFF_LANGUAGE_BUTTON;
#endif
wwin->frame = wFrameWindowCreate(scr, WMFloatingLevel,