mirror of
https://github.com/dylanaraps/sowm.git
synced 2026-10-26 12:24:51 +00:00
catwm: Added center_window
This commit is contained in:
1 parent
efc1327d0e
commit
277bd8d2de
2 files changed
+13
-23
No files matched your search
@@ -51,6 +51,7 @@ struct desktop{
|
||||
static void add_window(Window w);
|
||||
static void buttonpress(XEvent *e);
|
||||
static void buttonrelease(XEvent *e);
|
||||
static void center_window();
|
||||
static void change_desktop(const Arg arg);
|
||||
static void client_to_desktop(const Arg arg);
|
||||
static void configurerequest(XEvent *e);
|
||||
@@ -140,6 +141,15 @@ void change_desktop(const Arg arg) {
|
||||
update_current();
|
||||
}
|
||||
|
||||
void center_window() {
|
||||
XGetWindowAttributes(dis, current->win, &attr);
|
||||
|
||||
int x = (sw / 2) - (attr.width / 2);
|
||||
int y = (sh / 2) - (attr.height / 2);
|
||||
|
||||
XMoveWindow(dis, current->win, x, y);
|
||||
}
|
||||
|
||||
void client_to_desktop(const Arg arg) {
|
||||
client *tmp = current;
|
||||
int tmp2 = curr_desk;
|
||||
|
||||
Reference in new issue
Block a user