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

put back TITLEBAR_EXTEND_SPACE but with default value = 4 instead

change cursor fonts' behavior
This commit is contained in:
id
2000-03-04 01:22:30 +00:00
parent 93941b2c03
commit 37217ce180
6 changed files with 60 additions and 21 deletions

View File

@@ -123,13 +123,19 @@ typedef enum {
#define WCUR_NORMAL 0
#define WCUR_MOVE 1
#define WCUR_RESIZE 2
#define WCUR_WAIT 3
#define WCUR_ARROW 4
#define WCUR_QUESTION 5
#define WCUR_TEXT 6
#define WCUR_SELECT 7
#define WCUR_ROOT 8
#define WCUR_LAST 9
#define WCUR_TOPLEFTRESIZE 3
#define WCUR_TOPRIGHTRESIZE 4
#define WCUR_BOTTOMLEFTRESIZE 5
#define WCUR_BOTTOMRIGHTRESIZE 6
#define WCUR_VERTICALRESIZE 7
#define WCUR_HORIZONRESIZE 8
#define WCUR_WAIT 9
#define WCUR_ARROW 10
#define WCUR_QUESTION 11
#define WCUR_TEXT 12
#define WCUR_SELECT 13
#define WCUR_ROOT 14
#define WCUR_LAST 15
/* geometry displays */
#define WDIS_NEW 0 /* new style */

View File

@@ -138,7 +138,7 @@ wFrameWindowUpdateBorders(WFrameWindow *fwin, int flags)
height = fwin->core->height - fwin->top_width - fwin->bottom_width;
if (flags & WFF_TITLEBAR)
theight = WMFontHeight(*fwin->font) + *fwin->title_clearance * 2;
theight = WMFontHeight(*fwin->font) + (*fwin->title_clearance + TITLEBAR_EXTEND_SPACE) * 2;
else
theight = 0;
@@ -476,7 +476,7 @@ updateTitlebar(WFrameWindow *fwin)
int x, w;
int theight;
theight = WMFontHeight(*fwin->font) + *fwin->title_clearance * 2;
theight = WMFontHeight(*fwin->font) + (*fwin->title_clearance + TITLEBAR_EXTEND_SPACE) * 2;
x = 0;
w = fwin->core->width + 1;
@@ -1087,16 +1087,16 @@ wFrameWindowPaint(WFrameWindow *fwin)
proc.drawString(scr->drawstring_func[fwin->flags.state
+ fwin->drawstring_proc_offset]->arg,
fwin->titlebar->window, *fwin->title_gc,
*fwin->font, x, *fwin->title_clearance,
*fwin->font, x, *fwin->title_clearance + TITLEBAR_EXTEND_SPACE,
fwin->titlebar->width, fwin->top_width, title, titlelen);
} else {
WMDrawString(scr->wmscreen, fwin->titlebar->window,
*fwin->title_gc, *fwin->font, x, *fwin->title_clearance,
*fwin->title_gc, *fwin->font, x, *fwin->title_clearance + TITLEBAR_EXTEND_SPACE,
title, titlelen);
}
#else
WMDrawString(scr->wmscreen, fwin->titlebar->window,
*fwin->title_gc, *fwin->font, x, *fwin->title_clearance,
*fwin->title_gc, *fwin->font, x, *fwin->title_clearance + TITLEBAR_EXTEND_SPACE,
title, titlelen);
#endif /* DRAWSTRING_PLUGIN */

View File

@@ -427,7 +427,7 @@ drawTransparentFrame(WWindow *wwin, int x, int y, int width, int height)
int bottom = 0;
if (!WFLAGP(wwin, no_titlebar) && !wwin->flags.shaded) {
h = WMFontHeight(wwin->screen_ptr->title_font) + wPreferences.window_title_clearance * 2;
h = WMFontHeight(wwin->screen_ptr->title_font) + (wPreferences.window_title_clearance + TITLEBAR_EXTEND_SPACE) * 2;
}
if (!WFLAGP(wwin, no_resizebar) && !wwin->flags.shaded) {
/* Can't use wwin-frame->bottom_width because, in some cases
@@ -1853,7 +1853,7 @@ wMouseResizeWindow(WWindow *wwin, XEvent *ev)
shiftl = XKeysymToKeycode(dpy, XK_Shift_L);
shiftr = XKeysymToKeycode(dpy, XK_Shift_R);
if (!WFLAGP(wwin, no_titlebar))
h = WMFontHeight(wwin->screen_ptr->title_font) + wPreferences.window_title_clearance * 2;
h = WMFontHeight(wwin->screen_ptr->title_font) + (wPreferences.window_title_clearance + TITLEBAR_EXTEND_SPACE) * 2;
else
h = 0;
while (1) {
@@ -1936,9 +1936,35 @@ wMouseResizeWindow(WWindow *wwin, XEvent *ev)
orig_x - event.xmotion.x_root,
orig_y - event.xmotion.y_root, flags);
if (res == (UP|LEFT))
XChangeActivePointerGrab(dpy, ButtonMotionMask
| ButtonReleaseMask | ButtonPressMask,
wCursor[WCUR_RESIZE], CurrentTime);
wCursor[WCUR_TOPLEFTRESIZE], CurrentTime);
else if (res == (UP|RIGHT))
XChangeActivePointerGrab(dpy, ButtonMotionMask
| ButtonReleaseMask | ButtonPressMask,
wCursor[WCUR_TOPRIGHTRESIZE], CurrentTime);
else if (res == (DOWN|LEFT))
XChangeActivePointerGrab(dpy, ButtonMotionMask
| ButtonReleaseMask | ButtonPressMask,
wCursor[WCUR_BOTTOMLEFTRESIZE], CurrentTime);
else if (res == (DOWN|RIGHT))
XChangeActivePointerGrab(dpy, ButtonMotionMask
| ButtonReleaseMask | ButtonPressMask,
wCursor[WCUR_BOTTOMRIGHTRESIZE], CurrentTime);
else if (res == DOWN || res == UP)
XChangeActivePointerGrab(dpy, ButtonMotionMask
| ButtonReleaseMask | ButtonPressMask,
wCursor[WCUR_VERTICALRESIZE], CurrentTime);
else if (res & (DOWN|UP))
XChangeActivePointerGrab(dpy, ButtonMotionMask
| ButtonReleaseMask | ButtonPressMask,
wCursor[WCUR_VERTICALRESIZE], CurrentTime);
else if (res & (LEFT|RIGHT))
XChangeActivePointerGrab(dpy, ButtonMotionMask
| ButtonReleaseMask | ButtonPressMask,
wCursor[WCUR_HORIZONRESIZE], CurrentTime);
XGrabKeyboard(dpy, root, False, GrabModeAsync, GrabModeAsync,
CurrentTime);
@@ -2159,7 +2185,7 @@ InteractivePlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
return;
}
if (!WFLAGP(wwin, no_titlebar)) {
h = WMFontHeight(scr->title_font) + wPreferences.window_title_clearance * 2;
h = WMFontHeight(scr->title_font) + (wPreferences.window_title_clearance + TITLEBAR_EXTEND_SPACE) * 2;
height += h;
}
if (!WFLAGP(wwin, no_resizebar)) {

View File

@@ -553,7 +553,7 @@ PlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
unsigned width, unsigned height)
{
WScreen *scr = wwin->screen_ptr;
int h = WMFontHeight(scr->title_font) + wPreferences.window_title_clearance * 2;
int h = WMFontHeight(scr->title_font) + (wPreferences.window_title_clearance + TITLEBAR_EXTEND_SPACE) * 2;
switch (wPreferences.window_placement) {
case WPM_MANUAL:

View File

@@ -743,6 +743,12 @@ StartUp(Bool defaultScreenOnly)
wCursor[WCUR_ARROW] = XCreateFontCursor(dpy, XC_top_left_arrow);
wCursor[WCUR_MOVE] = XCreateFontCursor(dpy, XC_fleur);
wCursor[WCUR_RESIZE] = XCreateFontCursor(dpy, XC_sizing);
wCursor[WCUR_TOPLEFTRESIZE] = XCreateFontCursor(dpy, XC_top_left_corner);
wCursor[WCUR_TOPRIGHTRESIZE] = XCreateFontCursor(dpy, XC_top_right_corner);
wCursor[WCUR_BOTTOMLEFTRESIZE] = XCreateFontCursor(dpy, XC_bottom_left_corner);
wCursor[WCUR_BOTTOMRIGHTRESIZE] = XCreateFontCursor(dpy, XC_bottom_right_corner);
wCursor[WCUR_VERTICALRESIZE] = XCreateFontCursor(dpy, XC_sb_v_double_arrow);
wCursor[WCUR_HORIZONRESIZE] = XCreateFontCursor(dpy, XC_sb_h_double_arrow);
wCursor[WCUR_WAIT] = XCreateFontCursor(dpy, XC_watch);
wCursor[WCUR_QUESTION] = XCreateFontCursor(dpy, XC_question_arrow);
wCursor[WCUR_TEXT] = XCreateFontCursor(dpy, XC_xterm); /* odd name???*/

View File

@@ -317,9 +317,10 @@
#define DEF_FRAME_THICKNESS 1 /* linewidth of the move/resize frame */
#define DEF_WINDOW_TITLE_EXTEND_SPACE "4"
#define DEF_MENU_TITLE_EXTEND_SPACE "4"
#define DEF_WINDOW_TITLE_EXTEND_SPACE "0"
#define DEF_MENU_TITLE_EXTEND_SPACE "0"
#define DEF_MENU_TEXT_EXTEND_SPACE "0"
#define TITLEBAR_EXTEND_SPACE 4
#define DEF_XPM_CLOSENESS 40000