mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 04:48:06 +01:00
Fixes relate to modelock.
This commit is contained in:
@@ -109,12 +109,12 @@ typedef enum {
|
|||||||
#define WBUT_ICONIFY 2
|
#define WBUT_ICONIFY 2
|
||||||
#define WBUT_KILL 3
|
#define WBUT_KILL 3
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
#define WBUT_THAI 4
|
#define WBUT_XKBGROUP1 4
|
||||||
#define WBUT_ENGL 5
|
#define WBUT_XKBGROUP2 5
|
||||||
|
#define WBUT_XKBGROUP3 6
|
||||||
#define PRED_BPIXMAPS 6 /* count of WBUT icons */
|
#define WBUT_XKBGROUP4 7
|
||||||
|
#define PRED_BPIXMAPS 8 /* reserved for 4 groups */
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#define PRED_BPIXMAPS 4 /* count of WBUT icons */
|
#define PRED_BPIXMAPS 4 /* count of WBUT icons */
|
||||||
#endif /* XKB_BUTTON_HINT */
|
#endif /* XKB_BUTTON_HINT */
|
||||||
|
|
||||||
|
|||||||
@@ -99,23 +99,7 @@ static char *PRED_ICONIFY_XPM[] = {
|
|||||||
|
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
|
|
||||||
static char *PRED_THAI_XPM[] = {
|
static char *PRED_XKBGROUP1_XPM[] = {
|
||||||
" 10 10 2 1",
|
|
||||||
". c #000000",
|
|
||||||
"# c None",
|
|
||||||
"#..###..##",
|
|
||||||
".#..#.#..#",
|
|
||||||
".#...###..",
|
|
||||||
"#...####..",
|
|
||||||
"##..####..",
|
|
||||||
"##..####..",
|
|
||||||
"##..####..",
|
|
||||||
"##..####..",
|
|
||||||
"##..####..",
|
|
||||||
"##.#####.#"
|
|
||||||
};
|
|
||||||
|
|
||||||
static char *PRED_ENGL_XPM[] = {
|
|
||||||
" 10 10 2 1",
|
" 10 10 2 1",
|
||||||
". c #000000",
|
". c #000000",
|
||||||
"# c None",
|
"# c None",
|
||||||
@@ -131,6 +115,54 @@ static char *PRED_ENGL_XPM[] = {
|
|||||||
"........##"
|
"........##"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static char *PRED_XKBGROUP2_XPM[] = {
|
||||||
|
" 10 10 2 1",
|
||||||
|
". c #000000",
|
||||||
|
"# c None",
|
||||||
|
"#..###..##",
|
||||||
|
".#..#.#..#",
|
||||||
|
".#...###..",
|
||||||
|
"#...####..",
|
||||||
|
"##..####..",
|
||||||
|
"##..####..",
|
||||||
|
"##..####..",
|
||||||
|
"##..####..",
|
||||||
|
"##..####..",
|
||||||
|
"##.#####.#"
|
||||||
|
};
|
||||||
|
|
||||||
|
static char *PRED_XKBGROUP3_XPM[] = {
|
||||||
|
" 10 10 2 1",
|
||||||
|
". c #000000",
|
||||||
|
"# c None",
|
||||||
|
"##########",
|
||||||
|
"##########",
|
||||||
|
"##..##..##",
|
||||||
|
"##..##..##",
|
||||||
|
"##########",
|
||||||
|
"##########",
|
||||||
|
"#........#",
|
||||||
|
"##......##",
|
||||||
|
"###....###",
|
||||||
|
"##########"
|
||||||
|
};
|
||||||
|
|
||||||
|
static char *PRED_XKBGROUP4_XPM[] = {
|
||||||
|
" 10 10 2 1",
|
||||||
|
". c #000000",
|
||||||
|
"# c None",
|
||||||
|
"##########",
|
||||||
|
"##########",
|
||||||
|
"##..##..##",
|
||||||
|
"##..##..##",
|
||||||
|
"##########",
|
||||||
|
"##########",
|
||||||
|
"#........#",
|
||||||
|
"##......##",
|
||||||
|
"###....###",
|
||||||
|
"##########"
|
||||||
|
};
|
||||||
|
|
||||||
#endif /* XKB_BUTTON_HINT */
|
#endif /* XKB_BUTTON_HINT */
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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_THAI_BUTTON);
|
wFrameWindowHideButton(wwin->frame, WFF_XKB_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_THAI_BUTTON);
|
wFrameWindowHideButton(wwin->frame, WFF_XKB_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_THAI_BUTTON);
|
wFrameWindowHideButton(wwin->frame, WFF_XKB_BUTTON);
|
||||||
#endif
|
#endif
|
||||||
wwin->frame->on_click_right = destroyGNUstepPanel;
|
wwin->frame->on_click_right = destroyGNUstepPanel;
|
||||||
|
|
||||||
|
|||||||
26
src/event.c
26
src/event.c
@@ -446,13 +446,16 @@ saveTimestamp(XEvent *event)
|
|||||||
static void
|
static void
|
||||||
handleExtensions(XEvent *event)
|
handleExtensions(XEvent *event)
|
||||||
{
|
{
|
||||||
|
XkbEvent *xkbevent;
|
||||||
|
xkbevent = event;
|
||||||
#ifdef SHAPE
|
#ifdef SHAPE
|
||||||
if (wShapeSupported && event->type == (wShapeEventBase+ShapeNotify)) {
|
if (wShapeSupported && event->type == (wShapeEventBase+ShapeNotify)) {
|
||||||
handleShapeNotify(event);
|
handleShapeNotify(event);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef KEEP_XKB_LOCK_STATUS
|
#ifdef KEEP_XKB_LOCK_STATUS
|
||||||
if (wPreferences.modelock && event->type == (0x50|XkbIndicatorStateNotify)){
|
if (wPreferences.modelock &&
|
||||||
|
(event->type == 0x54)){
|
||||||
/* if someone know how to call this 0x50
|
/* if someone know how to call this 0x50
|
||||||
* or how to clean code this please tell ]d */
|
* or how to clean code this please tell ]d */
|
||||||
handleXkbIndicatorStateNotify(event);
|
handleXkbIndicatorStateNotify(event);
|
||||||
@@ -1157,23 +1160,20 @@ handleXkbIndicatorStateNotify(XEvent *event)
|
|||||||
XkbStateRec staterec;
|
XkbStateRec staterec;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
XkbGetState(dpy,XkbUseCoreKbd,&staterec);
|
|
||||||
for (i=0; i<wScreenCount; i++) {
|
for (i=0; i<wScreenCount; i++) {
|
||||||
scr = wScreenWithNumber(i);
|
scr = wScreenWithNumber(i);
|
||||||
wwin = scr->focused_window;
|
wwin = scr->focused_window;
|
||||||
if (wwin->flags.focused) {
|
if (wwin->flags.focused) {
|
||||||
wwin->frame->languagemode=staterec.compat_state&32?1:0;
|
XkbGetState(dpy,XkbUseCoreKbd,&staterec);
|
||||||
|
if (wwin->frame->languagemode != staterec.group) {
|
||||||
|
wwin->frame->last_languagemode = wwin->frame->languagemode;
|
||||||
|
wwin->frame->languagemode = staterec.group;
|
||||||
|
}
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
if (wwin->frame->titlebar) {
|
if (wwin->frame->titlebar) {
|
||||||
wFrameWindowPaint(wwin->frame);
|
wFrameWindowPaint(wwin->frame);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef XKB_TITLE_HINT
|
|
||||||
if (wwin->frame->titlebar) {
|
|
||||||
XClearWindow(dpy, wwin->frame->titlebar->window);
|
|
||||||
wFrameWindowPaint(wwin->frame);
|
|
||||||
}
|
|
||||||
#endif /* XKB_TITLE_HINT */
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1774,11 +1774,11 @@ handleKeyPress(XEvent *event)
|
|||||||
if (wwin && wwin->flags.mapped
|
if (wwin && wwin->flags.mapped
|
||||||
&& wwin->frame->workspace == wwin->screen_ptr->current_workspace
|
&& wwin->frame->workspace == wwin->screen_ptr->current_workspace
|
||||||
&& !wwin->flags.miniaturized && !wwin->flags.hidden) {
|
&& !wwin->flags.miniaturized && !wwin->flags.hidden) {
|
||||||
XkbGetState(dpy,XkbUseCoreKbd,&staterec);
|
XkbGetState(dpy,XkbUseCoreKbd,&staterec);
|
||||||
|
|
||||||
wwin->frame->languagemode = staterec.compat_state&32
|
wwin->frame->languagemode = wwin->frame->last_languagemode;
|
||||||
? 0 : 1;
|
wwin->frame->last_languagemode = staterec.group;
|
||||||
XkbLockGroup(dpy,XkbUseCoreKbd, wwin->frame->languagemode);
|
XkbLockGroup(dpy,XkbUseCoreKbd, wwin->frame->languagemode);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
223
src/framewin.c
223
src/framewin.c
@@ -23,6 +23,9 @@
|
|||||||
|
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include <X11/Xutil.h>
|
#include <X11/Xutil.h>
|
||||||
|
#ifdef KEEP_XKB_LOCK_STATUS
|
||||||
|
#include <X11/XKBlib.h>
|
||||||
|
#endif /* KEEP_XKB_LOCK_STATUS */
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -78,6 +81,10 @@ wFrameWindowCreate(WScreen *scr, int wlevel, int x, int y,
|
|||||||
fwin->title_pixel = color;
|
fwin->title_pixel = color;
|
||||||
fwin->title_gc = gc;
|
fwin->title_gc = gc;
|
||||||
fwin->font = font;
|
fwin->font = font;
|
||||||
|
#ifdef KEEP_XKB_LOCK_STATUS
|
||||||
|
fwin->languagemode = XkbGroup1Index;
|
||||||
|
fwin->last_languagemode = XkbGroup2Index;
|
||||||
|
#endif
|
||||||
|
|
||||||
fwin->core = wCoreCreateTopLevel(scr, x, y, width, height,
|
fwin->core = wCoreCreateTopLevel(scr, x, y, width, height,
|
||||||
FRAME_BORDER_WIDTH);
|
FRAME_BORDER_WIDTH);
|
||||||
@@ -145,12 +152,12 @@ wFrameWindowUpdateBorders(WFrameWindow *fwin, int flags)
|
|||||||
wCoreConfigure(fwin->left_button, 0, 0, bsize, bsize);
|
wCoreConfigure(fwin->left_button, 0, 0, bsize, bsize);
|
||||||
}
|
}
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
if (fwin->thai_button)
|
if (fwin->language_button)
|
||||||
if (fwin->flags.hide_left_button || !fwin->left_button
|
if (fwin->flags.hide_left_button || !fwin->left_button
|
||||||
|| fwin->flags.lbutton_dont_fit) {
|
|| fwin->flags.lbutton_dont_fit) {
|
||||||
wCoreConfigure(fwin->thai_button, 0, 0, bsize, bsize);
|
wCoreConfigure(fwin->language_button, 0, 0, bsize, bsize);
|
||||||
} else {
|
} else {
|
||||||
wCoreConfigure(fwin->thai_button, bsize, 0, bsize, bsize);
|
wCoreConfigure(fwin->language_button, bsize, 0, bsize, bsize);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -166,8 +173,8 @@ wFrameWindowUpdateBorders(WFrameWindow *fwin, int flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
if (fwin->thai_button) {
|
if (fwin->language_button) {
|
||||||
wCoreConfigure(fwin->thai_button, 6 + bsize, (theight-bsize)/2,
|
wCoreConfigure(fwin->language_button, 6 + bsize, (theight-bsize)/2,
|
||||||
bsize, bsize);
|
bsize, bsize);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -187,7 +194,7 @@ wFrameWindowUpdateBorders(WFrameWindow *fwin, int flags)
|
|||||||
FREE_PIXMAP(fwin->lbutton_back[i]);
|
FREE_PIXMAP(fwin->lbutton_back[i]);
|
||||||
FREE_PIXMAP(fwin->rbutton_back[i]);
|
FREE_PIXMAP(fwin->rbutton_back[i]);
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
FREE_PIXMAP(fwin->tbutton_back[i]);
|
FREE_PIXMAP(fwin->languagebutton_back[i]);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -196,9 +203,9 @@ wFrameWindowUpdateBorders(WFrameWindow *fwin, int flags)
|
|||||||
fwin->left_button = NULL;
|
fwin->left_button = NULL;
|
||||||
|
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
if (fwin->thai_button)
|
if (fwin->language_button)
|
||||||
wCoreDestroy(fwin->thai_button);
|
wCoreDestroy(fwin->language_button);
|
||||||
fwin->thai_button = NULL;
|
fwin->language_button = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (fwin->right_button)
|
if (fwin->right_button)
|
||||||
@@ -246,29 +253,29 @@ wFrameWindowUpdateBorders(WFrameWindow *fwin, int flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
if (flags & WFF_THAI_BUTTON) {
|
if (flags & WFF_XKB_BUTTON) {
|
||||||
fwin->flags.thai_button = 1;
|
fwin->flags.language_button = 1;
|
||||||
if (wPreferences.new_style) {
|
if (wPreferences.new_style) {
|
||||||
fwin->thai_button = wCoreCreate(fwin->core,
|
fwin->language_button = wCoreCreate(fwin->core,
|
||||||
bsize, 0, bsize, bsize);
|
bsize, 0, bsize, bsize);
|
||||||
|
|
||||||
if (width < theight*4) {
|
if (width < theight*4) {
|
||||||
fwin->flags.tbutton_dont_fit = 1;
|
fwin->flags.languagebutton_dont_fit = 1;
|
||||||
} else {
|
} else {
|
||||||
XMapRaised(dpy, fwin->thai_button->window);
|
XMapRaised(dpy, fwin->language_button->window);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fwin->thai_button =
|
fwin->language_button =
|
||||||
wCoreCreate(fwin->titlebar, bsize + 6, (theight-bsize)/2,
|
wCoreCreate(fwin->titlebar, bsize + 6, (theight-bsize)/2,
|
||||||
bsize, bsize);
|
bsize, bsize);
|
||||||
|
|
||||||
XSetWindowBackground(dpy, fwin->thai_button->window,
|
XSetWindowBackground(dpy, fwin->language_button->window,
|
||||||
scr->widget_texture->normal.pixel);
|
scr->widget_texture->normal.pixel);
|
||||||
|
|
||||||
if (width < theight*3) {
|
if (width < theight*3) {
|
||||||
fwin->flags.tbutton_dont_fit = 1;
|
fwin->flags.languagebutton_dont_fit = 1;
|
||||||
} else {
|
} else {
|
||||||
XMapRaised(dpy, fwin->thai_button->window);
|
XMapRaised(dpy, fwin->language_button->window);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -372,11 +379,11 @@ wFrameWindowUpdateBorders(WFrameWindow *fwin, int flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
if (fwin->thai_button) {
|
if (fwin->language_button) {
|
||||||
fwin->thai_button->descriptor.handle_expose = handleButtonExpose;
|
fwin->language_button->descriptor.handle_expose = handleButtonExpose;
|
||||||
fwin->thai_button->descriptor.parent = fwin;
|
fwin->language_button->descriptor.parent = fwin;
|
||||||
fwin->thai_button->descriptor.parent_type = WCLASS_FRAME;
|
fwin->language_button->descriptor.parent_type = WCLASS_FRAME;
|
||||||
fwin->thai_button->descriptor.handle_mousedown = buttonMouseDown;
|
fwin->language_button->descriptor.handle_mousedown = buttonMouseDown;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -402,8 +409,8 @@ wFrameWindowDestroy(WFrameWindow *fwin)
|
|||||||
wCoreDestroy(fwin->left_button);
|
wCoreDestroy(fwin->left_button);
|
||||||
|
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
if (fwin->thai_button)
|
if (fwin->language_button)
|
||||||
wCoreDestroy(fwin->thai_button);
|
wCoreDestroy(fwin->language_button);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (fwin->right_button)
|
if (fwin->right_button)
|
||||||
@@ -427,7 +434,7 @@ wFrameWindowDestroy(WFrameWindow *fwin)
|
|||||||
if (wPreferences.new_style) {
|
if (wPreferences.new_style) {
|
||||||
FREE_PIXMAP(fwin->lbutton_back[i]);
|
FREE_PIXMAP(fwin->lbutton_back[i]);
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
FREE_PIXMAP(fwin->tbutton_back[i]);
|
FREE_PIXMAP(fwin->languagebutton_back[i]);
|
||||||
#endif
|
#endif
|
||||||
FREE_PIXMAP(fwin->rbutton_back[i]);
|
FREE_PIXMAP(fwin->rbutton_back[i]);
|
||||||
}
|
}
|
||||||
@@ -466,27 +473,27 @@ updateTitlebar(WFrameWindow *fwin)
|
|||||||
|| fwin->flags.lbutton_dont_fit) {
|
|| fwin->flags.lbutton_dont_fit) {
|
||||||
x = 0;
|
x = 0;
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
if(fwin->thai_button)
|
if(fwin->language_button)
|
||||||
wCoreConfigure(fwin->thai_button, 0, 0,
|
wCoreConfigure(fwin->language_button, 0, 0,
|
||||||
fwin->thai_button->width,
|
fwin->language_button->width,
|
||||||
fwin->thai_button->width);
|
fwin->language_button->width);
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
if(fwin->thai_button)
|
if(fwin->language_button)
|
||||||
wCoreConfigure(fwin->thai_button, fwin->left_button->width, 0,
|
wCoreConfigure(fwin->language_button, fwin->left_button->width, 0,
|
||||||
fwin->thai_button->width,
|
fwin->language_button->width,
|
||||||
fwin->thai_button->width);
|
fwin->language_button->width);
|
||||||
#endif
|
#endif
|
||||||
x = fwin->left_button->width;
|
x = fwin->left_button->width;
|
||||||
w -= fwin->left_button->width;
|
w -= fwin->left_button->width;
|
||||||
}
|
}
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
if (fwin->flags.hide_thai_button || !fwin->thai_button
|
if (fwin->flags.hide_language_button || !fwin->language_button
|
||||||
|| fwin->flags.tbutton_dont_fit) {
|
|| fwin->flags.languagebutton_dont_fit) {
|
||||||
} else {
|
} else {
|
||||||
x += fwin->thai_button->width;
|
x += fwin->language_button->width;
|
||||||
w -= fwin->thai_button->width;
|
w -= fwin->language_button->width;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -495,17 +502,17 @@ updateTitlebar(WFrameWindow *fwin)
|
|||||||
int bsize = theight - 7;
|
int bsize = theight - 7;
|
||||||
if (fwin->flags.hide_left_button || !fwin->left_button
|
if (fwin->flags.hide_left_button || !fwin->left_button
|
||||||
|| fwin->flags.lbutton_dont_fit) {
|
|| fwin->flags.lbutton_dont_fit) {
|
||||||
if(fwin->thai_button)
|
if(fwin->language_button)
|
||||||
wCoreConfigure(fwin->thai_button, 3, (theight-bsize)/2,
|
wCoreConfigure(fwin->language_button, 3, (theight-bsize)/2,
|
||||||
fwin->thai_button->width,
|
fwin->language_button->width,
|
||||||
fwin->thai_button->width);
|
fwin->language_button->width);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(fwin->thai_button)
|
if(fwin->language_button)
|
||||||
wCoreConfigure(fwin->thai_button,
|
wCoreConfigure(fwin->language_button,
|
||||||
6 + fwin->left_button->width, (theight-bsize)/2,
|
6 + fwin->left_button->width, (theight-bsize)/2,
|
||||||
fwin->thai_button->width,
|
fwin->language_button->width,
|
||||||
fwin->thai_button->width);
|
fwin->language_button->width);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -538,9 +545,9 @@ wFrameWindowHideButton(WFrameWindow *fwin, int flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
if ((flags & WFF_THAI_BUTTON) && fwin->thai_button) {
|
if ((flags & WFF_XKB_BUTTON) && fwin->language_button) {
|
||||||
XUnmapWindow(dpy, fwin->thai_button->window);
|
XUnmapWindow(dpy, fwin->language_button->window);
|
||||||
fwin->flags.hide_thai_button = 1;
|
fwin->flags.hide_language_button = 1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -573,13 +580,13 @@ wFrameWindowShowButton(WFrameWindow *fwin, int flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
if ((flags & WFF_THAI_BUTTON) && fwin->thai_button
|
if ((flags & WFF_XKB_BUTTON) && fwin->language_button
|
||||||
&& fwin->flags.hide_thai_button) {
|
&& fwin->flags.hide_language_button) {
|
||||||
|
|
||||||
if (!fwin->flags.tbutton_dont_fit)
|
if (!fwin->flags.languagebutton_dont_fit)
|
||||||
XMapWindow(dpy, fwin->thai_button->window);
|
XMapWindow(dpy, fwin->language_button->window);
|
||||||
|
|
||||||
fwin->flags.hide_thai_button = 0;
|
fwin->flags.hide_language_button = 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -608,8 +615,8 @@ wFrameWindowShowButton(WFrameWindow *fwin, int flags)
|
|||||||
static void
|
static void
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
renderTexture(WScreen *scr, WTexture *texture, int width, int height,
|
renderTexture(WScreen *scr, WTexture *texture, int width, int height,
|
||||||
int bwidth, int bheight, int left, int thai, int right,
|
int bwidth, int bheight, int left, int language, int right,
|
||||||
Pixmap *title, Pixmap *lbutton, Pixmap *tbutton, Pixmap *rbutton)
|
Pixmap *title, Pixmap *lbutton, Pixmap *languagebutton, Pixmap *rbutton)
|
||||||
#else
|
#else
|
||||||
renderTexture(WScreen *scr, WTexture *texture, int width, int height,
|
renderTexture(WScreen *scr, WTexture *texture, int width, int height,
|
||||||
int bwidth, int bheight, int left, int right,
|
int bwidth, int bheight, int left, int right,
|
||||||
@@ -627,7 +634,7 @@ renderTexture(WScreen *scr, WTexture *texture, int width, int height,
|
|||||||
*lbutton = None;
|
*lbutton = None;
|
||||||
*rbutton = None;
|
*rbutton = None;
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
*tbutton = None;
|
*languagebutton = None;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
img = wTextureRenderImage(texture, width, height, WREL_FLAT);
|
img = wTextureRenderImage(texture, width, height, WREL_FLAT);
|
||||||
@@ -646,7 +653,7 @@ renderTexture(WScreen *scr, WTexture *texture, int width, int height,
|
|||||||
w = img->width;
|
w = img->width;
|
||||||
|
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
if (thai) {
|
if (language) {
|
||||||
timg = RGetSubImage(img, bwidth, 0, bwidth, bheight);
|
timg = RGetSubImage(img, bwidth, 0, bwidth, bheight);
|
||||||
} else
|
} else
|
||||||
timg = NULL;
|
timg = NULL;
|
||||||
@@ -665,7 +672,7 @@ renderTexture(WScreen *scr, WTexture *texture, int width, int height,
|
|||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
if (timg) {
|
if (timg) {
|
||||||
RBevelImage(timg, RBEV_RAISED2);
|
RBevelImage(timg, RBEV_RAISED2);
|
||||||
if (!RConvertImage(scr->rcontext, timg, tbutton)) {
|
if (!RConvertImage(scr->rcontext, timg, languagebutton)) {
|
||||||
wwarning(_("error rendering image:%s"), RMessageForError(RErrorCode));
|
wwarning(_("error rendering image:%s"), RMessageForError(RErrorCode));
|
||||||
}
|
}
|
||||||
x += timg->width;
|
x += timg->width;
|
||||||
@@ -785,9 +792,9 @@ updateTexture(WFrameWindow *fwin)
|
|||||||
fwin->lbutton_back[i]);
|
fwin->lbutton_back[i]);
|
||||||
|
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
if (fwin->thai_button && fwin->tbutton_back[i])
|
if (fwin->language_button && fwin->languagebutton_back[i])
|
||||||
XSetWindowBackgroundPixmap(dpy, fwin->thai_button->window,
|
XSetWindowBackgroundPixmap(dpy, fwin->language_button->window,
|
||||||
fwin->tbutton_back[i]);
|
fwin->languagebutton_back[i]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (fwin->right_button && fwin->rbutton_back[i])
|
if (fwin->right_button && fwin->rbutton_back[i])
|
||||||
@@ -802,8 +809,8 @@ updateTexture(WFrameWindow *fwin)
|
|||||||
XSetWindowBackground(dpy, fwin->left_button->window,
|
XSetWindowBackground(dpy, fwin->left_button->window,
|
||||||
pixel);
|
pixel);
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
if (fwin->thai_button)
|
if (fwin->language_button)
|
||||||
XSetWindowBackground(dpy, fwin->thai_button->window,
|
XSetWindowBackground(dpy, fwin->language_button->window,
|
||||||
pixel);
|
pixel);
|
||||||
#endif
|
#endif
|
||||||
if (fwin->right_button)
|
if (fwin->right_button)
|
||||||
@@ -818,9 +825,9 @@ updateTexture(WFrameWindow *fwin)
|
|||||||
handleButtonExpose(&fwin->left_button->descriptor, NULL);
|
handleButtonExpose(&fwin->left_button->descriptor, NULL);
|
||||||
}
|
}
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
if (fwin->thai_button) {
|
if (fwin->language_button) {
|
||||||
XClearWindow(dpy, fwin->thai_button->window);
|
XClearWindow(dpy, fwin->language_button->window);
|
||||||
handleButtonExpose(&fwin->thai_button->descriptor, NULL);
|
handleButtonExpose(&fwin->language_button->descriptor, NULL);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (fwin->right_button) {
|
if (fwin->right_button) {
|
||||||
@@ -846,14 +853,14 @@ remakeTexture(WFrameWindow *fwin, int state)
|
|||||||
FREE_PIXMAP(fwin->lbutton_back[state]);
|
FREE_PIXMAP(fwin->lbutton_back[state]);
|
||||||
FREE_PIXMAP(fwin->rbutton_back[state]);
|
FREE_PIXMAP(fwin->rbutton_back[state]);
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
FREE_PIXMAP(fwin->tbutton_back[state]);
|
FREE_PIXMAP(fwin->languagebutton_back[state]);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fwin->title_texture[state]->any.type!=WTEX_SOLID) {
|
if (fwin->title_texture[state]->any.type!=WTEX_SOLID) {
|
||||||
int left, right;
|
int left, right;
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
int thai;
|
int language;
|
||||||
#endif
|
#endif
|
||||||
int width;
|
int width;
|
||||||
|
|
||||||
@@ -861,8 +868,8 @@ remakeTexture(WFrameWindow *fwin, int state)
|
|||||||
left = fwin->left_button && !fwin->flags.hide_left_button
|
left = fwin->left_button && !fwin->flags.hide_left_button
|
||||||
&& !fwin->flags.lbutton_dont_fit;
|
&& !fwin->flags.lbutton_dont_fit;
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
thai = fwin->thai_button && !fwin->flags.hide_thai_button
|
language = fwin->language_button && !fwin->flags.hide_language_button
|
||||||
&& !fwin->flags.tbutton_dont_fit;
|
&& !fwin->flags.languagebutton_dont_fit;
|
||||||
#endif
|
#endif
|
||||||
right = fwin->right_button && !fwin->flags.hide_right_button
|
right = fwin->right_button && !fwin->flags.hide_right_button
|
||||||
&& !fwin->flags.rbutton_dont_fit;
|
&& !fwin->flags.rbutton_dont_fit;
|
||||||
@@ -873,7 +880,7 @@ remakeTexture(WFrameWindow *fwin, int state)
|
|||||||
renderTexture(fwin->screen_ptr, fwin->title_texture[state],
|
renderTexture(fwin->screen_ptr, fwin->title_texture[state],
|
||||||
width, fwin->titlebar->height,
|
width, fwin->titlebar->height,
|
||||||
fwin->titlebar->height, fwin->titlebar->height,
|
fwin->titlebar->height, fwin->titlebar->height,
|
||||||
left, thai, right, &pmap, &lpmap, &tpmap, &rpmap);
|
left, language, right, &pmap, &lpmap, &tpmap, &rpmap);
|
||||||
#else
|
#else
|
||||||
renderTexture(fwin->screen_ptr, fwin->title_texture[state],
|
renderTexture(fwin->screen_ptr, fwin->title_texture[state],
|
||||||
width, fwin->titlebar->height,
|
width, fwin->titlebar->height,
|
||||||
@@ -886,7 +893,7 @@ remakeTexture(WFrameWindow *fwin, int state)
|
|||||||
fwin->lbutton_back[state] = lpmap;
|
fwin->lbutton_back[state] = lpmap;
|
||||||
fwin->rbutton_back[state] = rpmap;
|
fwin->rbutton_back[state] = rpmap;
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
fwin->tbutton_back[state] = tpmap;
|
fwin->languagebutton_back[state] = tpmap;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1013,9 +1020,9 @@ wFrameWindowPaint(WFrameWindow *fwin)
|
|||||||
allButtons = 0;
|
allButtons = 0;
|
||||||
|
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
if (fwin->thai_button && !fwin->flags.hide_thai_button
|
if (fwin->language_button && !fwin->flags.hide_language_button
|
||||||
&& !fwin->flags.tbutton_dont_fit)
|
&& !fwin->flags.languagebutton_dont_fit)
|
||||||
lofs += fwin->thai_button->width;
|
lofs += fwin->language_button->width;
|
||||||
else
|
else
|
||||||
allButtons = 0;
|
allButtons = 0;
|
||||||
#endif
|
#endif
|
||||||
@@ -1028,30 +1035,12 @@ wFrameWindowPaint(WFrameWindow *fwin)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
if (fwin->languagemode) {
|
fwin->languagebutton_image =
|
||||||
fwin->tbutton_image = fwin->screen_ptr->b_pixmaps[WBUT_THAI];
|
fwin->screen_ptr->b_pixmaps[WBUT_XKBGROUP1 + fwin->languagemode];
|
||||||
}
|
|
||||||
else fwin->tbutton_image = fwin->screen_ptr->b_pixmaps[WBUT_ENGL];
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef XKB_TITLE_HINT
|
|
||||||
if(fwin->flags.is_client_window_frame) {
|
|
||||||
char * freebuff;
|
|
||||||
freebuff = (char *)wmalloc((strlen(fwin->title)+6)*sizeof(char));
|
|
||||||
if (fwin->flags.justification == WTJ_RIGHT)
|
|
||||||
sprintf(freebuff,"%s %s",fwin->title,fwin->languagemode?XKB_ON:XKB_OFF);
|
|
||||||
else
|
|
||||||
sprintf(freebuff,"%s %s",fwin->languagemode?XKB_ON:XKB_OFF,fwin->title);
|
|
||||||
title = ShrinkString(*fwin->font, freebuff,
|
|
||||||
fwin->titlebar->width - lofs - rofs);
|
|
||||||
free(freebuff);
|
|
||||||
}
|
|
||||||
else title = ShrinkString(*fwin->font, fwin->title,
|
|
||||||
fwin->titlebar->width - lofs - rofs);
|
|
||||||
#else
|
|
||||||
title = ShrinkString(*fwin->font, fwin->title,
|
title = ShrinkString(*fwin->font, fwin->title,
|
||||||
fwin->titlebar->width - lofs - rofs);
|
fwin->titlebar->width - lofs - rofs);
|
||||||
#endif /* XKB_TITLE_HINT */
|
|
||||||
titlelen = strlen(title);
|
titlelen = strlen(title);
|
||||||
w = wTextWidth((*fwin->font)->font, title, titlelen);
|
w = wTextWidth((*fwin->font)->font, title, titlelen);
|
||||||
|
|
||||||
@@ -1101,8 +1090,8 @@ wFrameWindowPaint(WFrameWindow *fwin)
|
|||||||
if (fwin->left_button)
|
if (fwin->left_button)
|
||||||
handleButtonExpose(&fwin->left_button->descriptor, NULL);
|
handleButtonExpose(&fwin->left_button->descriptor, NULL);
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
if (fwin->thai_button)
|
if (fwin->language_button)
|
||||||
handleButtonExpose(&fwin->thai_button->descriptor, NULL);
|
handleButtonExpose(&fwin->language_button->descriptor, NULL);
|
||||||
#endif
|
#endif
|
||||||
if (fwin->right_button)
|
if (fwin->right_button)
|
||||||
handleButtonExpose(&fwin->right_button->descriptor, NULL);
|
handleButtonExpose(&fwin->right_button->descriptor, NULL);
|
||||||
@@ -1156,19 +1145,19 @@ reconfigure(WFrameWindow *fwin, int x, int y, int width, int height,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
if (fwin->thai_button) {
|
if (fwin->language_button) {
|
||||||
if (width < fwin->top_width*k && !fwin->flags.tbutton_dont_fit) {
|
if (width < fwin->top_width*k && !fwin->flags.languagebutton_dont_fit) {
|
||||||
|
|
||||||
if (!fwin->flags.hide_thai_button) {
|
if (!fwin->flags.hide_language_button) {
|
||||||
XUnmapWindow(dpy, fwin->thai_button->window);
|
XUnmapWindow(dpy, fwin->language_button->window);
|
||||||
}
|
}
|
||||||
fwin->flags.tbutton_dont_fit = 1;
|
fwin->flags.languagebutton_dont_fit = 1;
|
||||||
} else if (width >= fwin->top_width*k && fwin->flags.tbutton_dont_fit) {
|
} else if (width >= fwin->top_width*k && fwin->flags.languagebutton_dont_fit) {
|
||||||
|
|
||||||
if (!fwin->flags.hide_thai_button) {
|
if (!fwin->flags.hide_language_button) {
|
||||||
XMapWindow(dpy, fwin->thai_button->window);
|
XMapWindow(dpy, fwin->language_button->window);
|
||||||
}
|
}
|
||||||
fwin->flags.tbutton_dont_fit = 0;
|
fwin->flags.languagebutton_dont_fit = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -1313,9 +1302,9 @@ checkTitleSize(WFrameWindow *fwin)
|
|||||||
width -= fwin->left_button->width + 3;
|
width -= fwin->left_button->width + 3;
|
||||||
|
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
if (fwin->thai_button && !fwin->flags.hide_thai_button
|
if (fwin->language_button && !fwin->flags.hide_language_button
|
||||||
&& !fwin->flags.tbutton_dont_fit)
|
&& !fwin->flags.languagebutton_dont_fit)
|
||||||
width -= fwin->thai_button->width + 3;
|
width -= fwin->language_button->width + 3;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (fwin->right_button && !fwin->flags.hide_right_button
|
if (fwin->right_button && !fwin->flags.hide_right_button
|
||||||
@@ -1431,12 +1420,12 @@ handleButtonExpose(WObjDescriptor *desc, XEvent *event)
|
|||||||
WCoreWindow *button = (WCoreWindow*)desc->self;
|
WCoreWindow *button = (WCoreWindow*)desc->self;
|
||||||
|
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
if (button == fwin->thai_button) {
|
if (button == fwin->language_button) {
|
||||||
|
|
||||||
if (wPreferences.modelock){
|
if (wPreferences.modelock){
|
||||||
paintButton(button, fwin->title_texture[fwin->flags.state],
|
paintButton(button, fwin->title_texture[fwin->flags.state],
|
||||||
fwin->title_pixel[fwin->flags.state],
|
fwin->title_pixel[fwin->flags.state],
|
||||||
fwin->tbutton_image, False);
|
fwin->languagebutton_image, False);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
@@ -1512,9 +1501,9 @@ buttonMouseDown(WObjDescriptor *desc, XEvent *event)
|
|||||||
image = fwin->rbutton_image;
|
image = fwin->rbutton_image;
|
||||||
}
|
}
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
if (button == fwin->thai_button) {
|
if (button == fwin->language_button) {
|
||||||
if (!wPreferences.modelock) return;
|
if (!wPreferences.modelock) return;
|
||||||
image = fwin->tbutton_image;
|
image = fwin->languagebutton_image;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1559,9 +1548,9 @@ buttonMouseDown(WObjDescriptor *desc, XEvent *event)
|
|||||||
(*fwin->on_click_right)(button, fwin->child, &ev);
|
(*fwin->on_click_right)(button, fwin->child, &ev);
|
||||||
}
|
}
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
else if (button == fwin->thai_button) {
|
else if (button == fwin->language_button) {
|
||||||
if (fwin->on_click_thai)
|
if (fwin->on_click_language)
|
||||||
(*fwin->on_click_thai)(button, fwin->child, &ev);
|
(*fwin->on_click_language)(button, fwin->child, &ev);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -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_THAI_BUTTON (1<<6)
|
#define WFF_XKB_BUTTON (1<<6)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ typedef struct WFrameWindow {
|
|||||||
WCoreWindow *titlebar; /* the titlebar */
|
WCoreWindow *titlebar; /* the titlebar */
|
||||||
WCoreWindow *left_button; /* miniaturize button */
|
WCoreWindow *left_button; /* miniaturize button */
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
WCoreWindow *thai_button;
|
WCoreWindow *language_button;
|
||||||
#endif
|
#endif
|
||||||
WCoreWindow *right_button; /* close button */
|
WCoreWindow *right_button; /* close button */
|
||||||
|
|
||||||
@@ -69,13 +69,13 @@ typedef struct WFrameWindow {
|
|||||||
Pixmap lbutton_back[3];
|
Pixmap lbutton_back[3];
|
||||||
Pixmap rbutton_back[3];
|
Pixmap rbutton_back[3];
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
Pixmap tbutton_back[3];
|
Pixmap languagebutton_back[3];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
WPixmap *lbutton_image;
|
WPixmap *lbutton_image;
|
||||||
WPixmap *rbutton_image;
|
WPixmap *rbutton_image;
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
WPixmap *tbutton_image;
|
WPixmap *languagebutton_image;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
union WTexture **title_texture;
|
union WTexture **title_texture;
|
||||||
@@ -88,6 +88,7 @@ typedef struct WFrameWindow {
|
|||||||
|
|
||||||
#ifdef KEEP_XKB_LOCK_STATUS
|
#ifdef KEEP_XKB_LOCK_STATUS
|
||||||
int languagemode;
|
int languagemode;
|
||||||
|
int last_languagemode;
|
||||||
#endif /* KEEP_XKB_LOCK_STATUS */
|
#endif /* KEEP_XKB_LOCK_STATUS */
|
||||||
|
|
||||||
/* thing that uses this frame. passed as data to callbacks */
|
/* thing that uses this frame. passed as data to callbacks */
|
||||||
@@ -96,7 +97,7 @@ typedef struct WFrameWindow {
|
|||||||
/* callbacks */
|
/* callbacks */
|
||||||
void (*on_click_left)(WCoreWindow *sender, void *data, XEvent *event);
|
void (*on_click_left)(WCoreWindow *sender, void *data, XEvent *event);
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
void (*on_click_thai)(WCoreWindow *sender, void *data, XEvent *event);
|
void (*on_click_language)(WCoreWindow *sender, void *data, XEvent *event);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void (*on_click_right)(WCoreWindow *sender, void *data, XEvent *event);
|
void (*on_click_right)(WCoreWindow *sender, void *data, XEvent *event);
|
||||||
@@ -115,7 +116,7 @@ typedef struct WFrameWindow {
|
|||||||
unsigned int left_button:1;
|
unsigned int left_button:1;
|
||||||
unsigned int right_button:1;
|
unsigned int right_button:1;
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
unsigned int thai_button:1;
|
unsigned int language_button:1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
unsigned int need_texture_remake:1;
|
unsigned int need_texture_remake:1;
|
||||||
@@ -125,7 +126,7 @@ typedef struct WFrameWindow {
|
|||||||
unsigned int hide_left_button:1;
|
unsigned int hide_left_button:1;
|
||||||
unsigned int hide_right_button:1;
|
unsigned int hide_right_button:1;
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
unsigned int hide_thai_button:1;
|
unsigned int hide_language_button:1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
unsigned int need_texture_change:1;
|
unsigned int need_texture_change:1;
|
||||||
@@ -133,7 +134,7 @@ typedef struct WFrameWindow {
|
|||||||
unsigned int lbutton_dont_fit:1;
|
unsigned int lbutton_dont_fit:1;
|
||||||
unsigned int rbutton_dont_fit:1;
|
unsigned int rbutton_dont_fit:1;
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
unsigned int tbutton_dont_fit:1;
|
unsigned int languagebutton_dont_fit:1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
unsigned int repaint_only_titlebar:1;
|
unsigned int repaint_only_titlebar:1;
|
||||||
|
|||||||
20
src/screen.c
20
src/screen.c
@@ -176,14 +176,22 @@ allocButtonPixmaps(WScreen *scr)
|
|||||||
pix->shared = 1;
|
pix->shared = 1;
|
||||||
scr->b_pixmaps[WBUT_ICONIFY] = pix;
|
scr->b_pixmaps[WBUT_ICONIFY] = pix;
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
pix = wPixmapCreateFromXPMData(scr, PRED_THAI_XPM);
|
pix = wPixmapCreateFromXPMData(scr, PRED_XKBGROUP1_XPM);
|
||||||
if (pix)
|
if (pix)
|
||||||
pix->shared = 1;
|
pix->shared = 1;
|
||||||
scr->b_pixmaps[WBUT_THAI] = pix;
|
scr->b_pixmaps[WBUT_XKBGROUP1] = pix;
|
||||||
pix = wPixmapCreateFromXPMData(scr, PRED_ENGL_XPM);
|
pix = wPixmapCreateFromXPMData(scr, PRED_XKBGROUP2_XPM);
|
||||||
if (pix)
|
if (pix)
|
||||||
pix->shared = 1;
|
pix->shared = 1;
|
||||||
scr->b_pixmaps[WBUT_ENGL] = pix;
|
scr->b_pixmaps[WBUT_XKBGROUP2] = pix;
|
||||||
|
pix = wPixmapCreateFromXPMData(scr, PRED_XKBGROUP3_XPM);
|
||||||
|
if (pix)
|
||||||
|
pix->shared = 1;
|
||||||
|
scr->b_pixmaps[WBUT_XKBGROUP3] = pix;
|
||||||
|
pix = wPixmapCreateFromXPMData(scr, PRED_XKBGROUP4_XPM);
|
||||||
|
if (pix)
|
||||||
|
pix->shared = 1;
|
||||||
|
scr->b_pixmaps[WBUT_XKBGROUP4] = pix;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -705,8 +713,8 @@ wScreenInit(int screen_number)
|
|||||||
XSelectInput(dpy, scr->root_win, event_mask);
|
XSelectInput(dpy, scr->root_win, event_mask);
|
||||||
|
|
||||||
#ifdef KEEP_XKB_LOCK_STATUS
|
#ifdef KEEP_XKB_LOCK_STATUS
|
||||||
XkbSelectEvents(dpy,XkbUseCoreKbd,XkbIndicatorStateNotifyMask,
|
XkbSelectEventDetails(dpy,XkbUseCoreKbd,XkbIndicatorStateNotify,
|
||||||
XkbIndicatorStateNotifyMask);
|
XkbIndicatorStateNotifyMask, XkbIndicatorStateNotifyMask);
|
||||||
#endif /* KEEP_XKB_LOCK_STATUS */
|
#endif /* KEEP_XKB_LOCK_STATUS */
|
||||||
|
|
||||||
XSync(dpy, False);
|
XSync(dpy, False);
|
||||||
|
|||||||
@@ -46,10 +46,7 @@ typedef struct WFont {
|
|||||||
#define WTB_FOCUSED 0
|
#define WTB_FOCUSED 0
|
||||||
#define WTB_UNFOCUSED 2
|
#define WTB_UNFOCUSED 2
|
||||||
#define WTB_PFOCUSED 4
|
#define WTB_PFOCUSED 4
|
||||||
#define WTB_MENU 6
|
#define WTB_MENU 6
|
||||||
#ifdef XKB_BUTTON_HINT
|
|
||||||
#define WTB_THAI 7
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef GNOME_STUFF
|
#ifdef GNOME_STUFF
|
||||||
/* an area of the screen reserved by some window */
|
/* an area of the screen reserved by some window */
|
||||||
@@ -263,11 +260,7 @@ typedef struct _WScreen {
|
|||||||
struct WDialogData *dialog_data;
|
struct WDialogData *dialog_data;
|
||||||
|
|
||||||
#ifdef NEWSTUFF
|
#ifdef NEWSTUFF
|
||||||
#ifdef XKB_BUTTON_HINT
|
|
||||||
struct RImage *button_images[3][PRED_BPIXMAPS];
|
|
||||||
#else
|
|
||||||
struct RImage *button_images[2][PRED_BPIXMAPS];/* scaled tbar btn images */
|
struct RImage *button_images[2][PRED_BPIXMAPS];/* scaled tbar btn images */
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* state and other informations */
|
/* state and other informations */
|
||||||
|
|||||||
29
src/window.c
29
src/window.c
@@ -124,7 +124,7 @@ static void windowCloseDblClick(WCoreWindow *sender, void *data, XEvent *event);
|
|||||||
static void windowIconifyClick(WCoreWindow *sender, void *data, XEvent *event);
|
static void windowIconifyClick(WCoreWindow *sender, void *data, XEvent *event);
|
||||||
|
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
static void windowThaiClick(WCoreWindow *sender, void *data, XEvent *event);
|
static void windowLanguageClick(WCoreWindow *sender, void *data, XEvent *event);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void titlebarMouseDown(WCoreWindow *sender, void *data, XEvent *event);
|
static void titlebarMouseDown(WCoreWindow *sender, void *data, XEvent *event);
|
||||||
@@ -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_THAI_BUTTON;
|
foo |= WFF_XKB_BUTTON;
|
||||||
#endif
|
#endif
|
||||||
if (!WFLAGP(wwin, no_titlebar))
|
if (!WFLAGP(wwin, no_titlebar))
|
||||||
foo |= WFF_TITLEBAR;
|
foo |= WFF_TITLEBAR;
|
||||||
@@ -943,8 +943,7 @@ wManageWindow(WScreen *scr, Window window)
|
|||||||
wwin->frame->on_click_left = windowIconifyClick;
|
wwin->frame->on_click_left = windowIconifyClick;
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
if (wPreferences.modelock)
|
if (wPreferences.modelock)
|
||||||
wwin->frame->on_click_thai = windowThaiClick;
|
wwin->frame->on_click_language = windowLanguageClick;
|
||||||
else wwin->frame->on_click_thai = NULL;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wwin->frame->on_click_right = windowCloseClick;
|
wwin->frame->on_click_right = windowCloseClick;
|
||||||
@@ -1255,7 +1254,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_THAI_BUTTON;
|
foo |= WFF_XKB_BUTTON;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wwin->frame = wFrameWindowCreate(scr, WMFloatingLevel,
|
wwin->frame = wFrameWindowCreate(scr, WMFloatingLevel,
|
||||||
@@ -1284,10 +1283,9 @@ wManageInternalWindow(WScreen *scr, Window window, Window owner,
|
|||||||
|
|
||||||
wwin->frame->workspace = wwin->screen_ptr->current_workspace;
|
wwin->frame->workspace = wwin->screen_ptr->current_workspace;
|
||||||
|
|
||||||
#ifdef THAI
|
#ifdef XKB_BUTTON_HINT
|
||||||
if (wPreferences.modelock)
|
if (wPreferences.modelock)
|
||||||
wwin->frame->on_click_thai = windowThaiClick;
|
wwin->frame->on_click_language = windowLanguageClick;
|
||||||
else wwin->frame->on_click_thai = NULL;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wwin->frame->on_click_right = windowCloseClick;
|
wwin->frame->on_click_right = windowCloseClick;
|
||||||
@@ -2012,11 +2010,11 @@ wWindowUpdateButtonImages(WWindow *wwin)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
if (!WFLAGP(wwin, no_thai_button)) {
|
if (!WFLAGP(wwin, no_language_button)) {
|
||||||
if (fwin->tbutton_image && !fwin->tbutton_image->shared) {
|
if (fwin->languagebutton_image && !fwin->languagebutton_image->shared) {
|
||||||
wPixmapDestroy(fwin->tbutton_image);
|
wPixmapDestroy(fwin->languagebutton_image);
|
||||||
}
|
}
|
||||||
fwin->tbutton_image = scr->b_pixmaps[WBUT_ENGL];
|
fwin->languagebutton_image = scr->b_pixmaps[WBUT_XKBGROUP1 + fwin->languagemode];
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -2837,16 +2835,19 @@ windowCloseDblClick(WCoreWindow *sender, void *data, XEvent *event)
|
|||||||
|
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
static void
|
static void
|
||||||
windowThaiClick(WCoreWindow *sender, void *data, XEvent *event)
|
windowLanguageClick(WCoreWindow *sender, void *data, XEvent *event)
|
||||||
{
|
{
|
||||||
WWindow *wwin = data;
|
WWindow *wwin = data;
|
||||||
WFrameWindow *fwin = wwin->frame;
|
WFrameWindow *fwin = wwin->frame;
|
||||||
WScreen *scr = fwin->screen_ptr;
|
WScreen *scr = fwin->screen_ptr;
|
||||||
XkbStateRec staterec;
|
XkbStateRec staterec;
|
||||||
|
int tl;
|
||||||
|
|
||||||
if (event->xbutton.button != Button1 && event->xbutton.button != Button3)
|
if (event->xbutton.button != Button1 && event->xbutton.button != Button3)
|
||||||
return;
|
return;
|
||||||
wwin->frame->languagemode = !wwin->frame->languagemode;
|
tl = wwin->frame->languagemode;
|
||||||
|
wwin->frame->languagemode = wwin->frame->last_languagemode;
|
||||||
|
wwin->frame->last_languagemode = tl;
|
||||||
wFrameWindowPaint(fwin);
|
wFrameWindowPaint(fwin);
|
||||||
wSetFocusTo(scr, wwin);
|
wSetFocusTo(scr, wwin);
|
||||||
if (event->xbutton.button == Button3)
|
if (event->xbutton.button == Button3)
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ typedef struct {
|
|||||||
unsigned int no_closable:1;
|
unsigned int no_closable:1;
|
||||||
unsigned int no_miniaturizable:1;
|
unsigned int no_miniaturizable:1;
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
unsigned int no_thai_button:1;
|
unsigned int no_language_button:1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* decorations */
|
/* decorations */
|
||||||
|
|||||||
Reference in New Issue
Block a user