mirror of
https://github.com/dylanaraps/sowm.git
synced 2025-05-19 01:20:23 -07:00
sowm: Shorter math for window centering.
This commit is contained in:
parent
518bb08dc0
commit
f098fde9cd
5
sowm.c
5
sowm.c
@ -335,8 +335,7 @@ void win_center(const Arg arg) {
|
||||
|
||||
win_size(w, &(int){0}, &(int){0}, &ww, &wh);
|
||||
|
||||
XMoveWindow(d, w, sw / 2 - ww / 2,
|
||||
sh / 2 - wh / 2);
|
||||
XMoveWindow(d, w, (sw - ww) / 2, (sh - wh) / 2);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -532,7 +531,7 @@ void run(const Arg arg) {
|
||||
int main(void) {
|
||||
XEvent ev;
|
||||
|
||||
if (!(d = XOpenDisplay(0))) return 0;
|
||||
if (!(d = XOpenDisplay(0))) exit(1);
|
||||
|
||||
signal(SIGCHLD, SIG_IGN);
|
||||
XSetErrorHandler(xerror);
|
||||
|
Loading…
x
Reference in New Issue
Block a user