From 37217ce180ae24850a39d0d0a2e108033a090a36 Mon Sep 17 00:00:00 2001 From: id Date: Sat, 4 Mar 2000 01:22:30 +0000 Subject: [PATCH] put back TITLEBAR_EXTEND_SPACE but with default value = 4 instead change cursor fonts' behavior --- src/WindowMaker.h | 20 +++++++++++++------- src/framewin.c | 10 +++++----- src/moveres.c | 38 ++++++++++++++++++++++++++++++++------ src/placement.c | 2 +- src/startup.c | 6 ++++++ src/wconfig.h.in | 5 +++-- 6 files changed, 60 insertions(+), 21 deletions(-) diff --git a/src/WindowMaker.h b/src/WindowMaker.h index 12128579..fded9b78 100644 --- a/src/WindowMaker.h +++ b/src/WindowMaker.h @@ -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 */ diff --git a/src/framewin.c b/src/framewin.c index 367f7875..a563b8db 100644 --- a/src/framewin.c +++ b/src/framewin.c @@ -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 */ diff --git a/src/moveres.c b/src/moveres.c index 83f8f8a6..a3922119 100644 --- a/src/moveres.c +++ b/src/moveres.c @@ -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); - XChangeActivePointerGrab(dpy, ButtonMotionMask - | ButtonReleaseMask | ButtonPressMask, - wCursor[WCUR_RESIZE], CurrentTime); + if (res == (UP|LEFT)) + XChangeActivePointerGrab(dpy, ButtonMotionMask + | ButtonReleaseMask | ButtonPressMask, + 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)) { diff --git a/src/placement.c b/src/placement.c index 6b1820b8..7e209e4b 100644 --- a/src/placement.c +++ b/src/placement.c @@ -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: diff --git a/src/startup.c b/src/startup.c index ae72b9e6..fd827902 100644 --- a/src/startup.c +++ b/src/startup.c @@ -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???*/ diff --git a/src/wconfig.h.in b/src/wconfig.h.in index 382f06db..efe7715e 100644 --- a/src/wconfig.h.in +++ b/src/wconfig.h.in @@ -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 -- 2.11.4.GIT