x = X(r);
y = bar_at_bottom ? (Y(r) + HEIGHT(r) - bar_height) : Y(r);
r->bar_window = XCreateSimpleWindow(display,
x = X(r);
y = bar_at_bottom ? (Y(r) + HEIGHT(r) - bar_height) : Y(r);
r->bar_window = XCreateSimpleWindow(display,
- r->s->root, x, y, WIDTH(r) - 2, bar_height - 2,
- 1, r->s->c[SWM_S_COLOR_BAR_BORDER].color,
+ r->s->root, x, y, WIDTH(r) - 2 * bar_border_width, bar_height - 2 * bar_border_width,
+ bar_border_width, r->s->c[SWM_S_COLOR_BAR_BORDER].color,
r->s->c[SWM_S_COLOR_BAR].color);
bar_gc = XCreateGC(display, r->bar_window, 0, &bar_gcv);
XSetFont(display, bar_gc, bar_fs->fid);
r->s->c[SWM_S_COLOR_BAR].color);
bar_gc = XCreateGC(display, r->bar_window, 0, &bar_gcv);
XSetFont(display, bar_gc, bar_fs->fid);
XSendEvent(display, win->id, False, StructureNotifyMask, (XEvent *)&cr);
}
XSendEvent(display, win->id, False, StructureNotifyMask, (XEvent *)&cr);
}
ce.above = None;
ce.override_redirect = False;
XSendEvent(display, win->id, False, StructureNotifyMask, (XEvent *)&ce);
ce.above = None;
ce.override_redirect = False;
XSendEvent(display, win->id, False, StructureNotifyMask, (XEvent *)&ce);
if (win->transient && (win->quirks & SWM_Q_TRANSSZ)) {
win->g.w = (double)WIDTH(r) * dialog_ratio;
win->g.h = (double)HEIGHT(r) * dialog_ratio;
if (win->transient && (win->quirks & SWM_Q_TRANSSZ)) {
win->g.w = (double)WIDTH(r) * dialog_ratio;
win->g.h = (double)HEIGHT(r) * dialog_ratio;
- win->g.x = r->g.x + (WIDTH(r) - win->g.w) / 2;
- win->g.y = r->g.y + (HEIGHT(r) - win->g.h) / 2;
+ win->g.x = r->g.x + (WIDTH(r) - win->g.w) / 2 - border_width;
+ win->g.y = r->g.y + (HEIGHT(r) - win->g.h) / 2 - border_width;
}
/* win can be outside r if new r smaller than old r */
/* Ensure top left corner inside r (move probs otherwise) */
}
/* win can be outside r if new r smaller than old r */
/* Ensure top left corner inside r (move probs otherwise) */
- (r->g.x + r->g.w - win->g.w - 2);
- if (win->g.y < r->g.y )
- win->g.y = r->g.y;
+ (r->g.x + r->g.w - win->g.w - 2 * border_width);
+ if (win->g.y < r->g.y - border_width)
+ win->g.y = r->g.y - border_width;
}
mask = CWX | CWY | CWWidth | CWHeight | CWBorderWidth;
XConfigureWindow(display, win->id, mask, &wc);
}
mask = CWX | CWY | CWWidth | CWHeight | CWBorderWidth;
XConfigureWindow(display, win->id, mask, &wc);
/* place pointer at bottom left corner or nearest point inside r */
if ( win->g.x + win->g.w < r->g.x + r->g.w - 1)
/* place pointer at bottom left corner or nearest point inside r */
if ( win->g.x + win->g.w < r->g.x + r->g.w - 1)
XWarpPointer(display, None, win->id, 0, 0, 0, 0, relx, rely);
do {
XWarpPointer(display, None, win->id, 0, 0, 0, 0, relx, rely);
do {
- /* not free, don't sync more than 60 times / second */
- if ((ev.xmotion.time - time) > (1000 / 60) ) {
+ /* not free, don't sync more than 120 times / second */
+ if ((ev.xmotion.time - time) > (1000 / 120) ) {
if (XGrabPointer(display, win->id, False, MOUSEMASK, GrabModeAsync,
GrabModeAsync, None, None /* cursor */, CurrentTime) != GrabSuccess)
return;
if (XGrabPointer(display, win->id, False, MOUSEMASK, GrabModeAsync,
GrabModeAsync, None, None /* cursor */, CurrentTime) != GrabSuccess)
return;
- XWarpPointer(display, None, win->id, 0, 0, 0, 0, -1, -1);
+ XWarpPointer(display, None, win->id, 0, 0, 0, 0, 0, 0);
do {
XMaskEvent(display, MOUSEMASK | ExposureMask |
SubstructureRedirectMask, &ev);
do {
XMaskEvent(display, MOUSEMASK | ExposureMask |
SubstructureRedirectMask, &ev);
- /* not free, don't sync more than 60 times / second */
- if ((ev.xmotion.time - time) > (1000 / 60) ) {
+ /* not free, don't sync more than 120 times / second */
+ if ((ev.xmotion.time - time) > (1000 / 120) ) {
-enum { SWM_S_BAR_DELAY, SWM_S_BAR_ENABLED, SWM_S_STACK_ENABLED,
+enum { SWM_S_BAR_DELAY, SWM_S_BAR_ENABLED, SWM_S_BAR_BORDER_WIDTH, SWM_S_STACK_ENABLED,
SWM_S_CLOCK_ENABLED, SWM_S_CLOCK_FORMAT, SWM_S_CYCLE_EMPTY,
SWM_S_CYCLE_VISIBLE, SWM_S_SS_ENABLED, SWM_S_TERM_WIDTH,
SWM_S_TITLE_CLASS_ENABLED, SWM_S_TITLE_NAME_ENABLED, SWM_S_WINDOW_NAME_ENABLED,
SWM_S_CLOCK_ENABLED, SWM_S_CLOCK_FORMAT, SWM_S_CYCLE_EMPTY,
SWM_S_CYCLE_VISIBLE, SWM_S_SS_ENABLED, SWM_S_TERM_WIDTH,
SWM_S_TITLE_CLASS_ENABLED, SWM_S_TITLE_NAME_ENABLED, SWM_S_WINDOW_NAME_ENABLED,
- SWM_S_FOCUS_MODE, SWM_S_DISABLE_BORDER, SWM_S_BAR_FONT,
+ SWM_S_FOCUS_MODE, SWM_S_DISABLE_BORDER, SWM_S_BORDER_WIDTH, SWM_S_BAR_FONT,
SWM_S_BAR_ACTION, SWM_S_SPAWN_TERM, SWM_S_SS_APP, SWM_S_DIALOG_RATIO,
SWM_S_BAR_AT_BOTTOM
};
SWM_S_BAR_ACTION, SWM_S_SPAWN_TERM, SWM_S_SS_APP, SWM_S_DIALOG_RATIO,
SWM_S_BAR_AT_BOTTOM
};
{ "bar_enabled", setconfvalue, SWM_S_BAR_ENABLED },
{ "bar_at_bottom", setconfvalue, SWM_S_BAR_AT_BOTTOM },
{ "bar_border", setconfcolor, SWM_S_COLOR_BAR_BORDER },
{ "bar_enabled", setconfvalue, SWM_S_BAR_ENABLED },
{ "bar_at_bottom", setconfvalue, SWM_S_BAR_AT_BOTTOM },
{ "bar_border", setconfcolor, SWM_S_COLOR_BAR_BORDER },
{ "bar_color", setconfcolor, SWM_S_COLOR_BAR },
{ "bar_font_color", setconfcolor, SWM_S_COLOR_BAR_FONT },
{ "bar_font", setconfvalue, SWM_S_BAR_FONT },
{ "bar_color", setconfcolor, SWM_S_COLOR_BAR },
{ "bar_font_color", setconfcolor, SWM_S_COLOR_BAR_FONT },
{ "bar_font", setconfvalue, SWM_S_BAR_FONT },
{ "title_name_enabled", setconfvalue, SWM_S_TITLE_NAME_ENABLED },
{ "focus_mode", setconfvalue, SWM_S_FOCUS_MODE },
{ "disable_border", setconfvalue, SWM_S_DISABLE_BORDER },
{ "title_name_enabled", setconfvalue, SWM_S_TITLE_NAME_ENABLED },
{ "focus_mode", setconfvalue, SWM_S_FOCUS_MODE },
{ "disable_border", setconfvalue, SWM_S_DISABLE_BORDER },
mask = CWBorderWidth;
XConfigureWindow(display, win->id, mask, &wc);
configreq_win(win);
mask = CWBorderWidth;
XConfigureWindow(display, win->id, mask, &wc);
configreq_win(win);