]> git.mdlowis.com Git - proto/lwm.git/commitdiff
removed ewmh and mouse files
authorMichael D. Lowis <mike@mdlowis.com>
Tue, 10 Mar 2020 00:54:55 +0000 (20:54 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Tue, 10 Mar 2020 00:54:55 +0000 (20:54 -0400)
client.c
disp.c
ewmh.c [deleted file]
ewmh.h [deleted file]
lwm.h
manage.c
mouse.c [deleted file]

index 377e53ded917a18f62f2d82e975865f83baa3463..b8d24be4d1b5f6dff8cf1ddfc1680d5eed9e429e 100644 (file)
--- a/client.c
+++ b/client.c
@@ -30,7 +30,6 @@
 #include <X11/Xatom.h>
 
 #include "lwm.h"
-#include "ewmh.h"
 
 Client *current;
 Client *last_focus = NULL;
@@ -273,13 +272,14 @@ Client_MakeSane(Client *c, Edge edge, int *x, int *y, int *dx, int *dy) {
 static void
 Client_OpaquePrimitive(Client *c, Edge edge) {
     Cursor cursor;
-    int ox, oy;
+    int ox, oy, t1, t2, b;
 
     if (c == 0 /*|| c != current*/)
         return;
 
     /* Find out where we've got hold of the window. */
-    getMousePosition(&ox, &oy);
+    Window wroot, child;
+    XQueryPointer(dpy, root, &wroot, &child, &ox, &oy, &t1, &t2, (unsigned int*)&b);
     ox = c->size.x - ox;
     oy = c->size.y - oy;
 
diff --git a/disp.c b/disp.c
index 1b4527429a029b2e7c4c1a957f4da0616f9dba05..bcafd91dd6dad90ebad15801796ad9b6dec4cef2 100644 (file)
--- a/disp.c
+++ b/disp.c
@@ -28,7 +28,6 @@
 #include <stdlib.h>
 
 #include "lwm.h"
-#include "ewmh.h"
 
 /*
  *  Dispatcher for main event loop.
@@ -574,7 +573,9 @@ reshaping_motionnotify(XEvent* ev) {
 
     if (mode != wm_reshaping || !current) return;
 
-    getMousePosition(&pointer_x, &pointer_y);
+    Window wroot, child;
+    int t1, t2, b;
+    XQueryPointer(dpy, root, &wroot, &child, &pointer_x, &pointer_y, &t1, &t2, (unsigned int*)&b);
 
     if (interacting_edge != ENone) {
         nx = ox = current->size.x;
diff --git a/ewmh.c b/ewmh.c
deleted file mode 100644 (file)
index 6b0b696..0000000
--- a/ewmh.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * lwm, a window manager for X11
- * Copyright (C) 1997-2016 Elliott Hughes, James Carter
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-#include <X11/X.h>
-#include <X11/Xos.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <X11/Xatom.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "lwm.h"
-#include "ewmh.h"
-
-Bool ewmh_get_window_name(Client *c) {
-    Atom rt, utf8_string;
-    char *name;
-    int fmt;
-    unsigned long n;
-    unsigned long extra;
-    int i;
-
-    utf8_string = XInternAtom(dpy, "UTF8_STRING", False);
-    i = XGetWindowProperty(dpy, c->window,
-        XInternAtom(dpy, "_NET_WM_NAME", False),
-        0, 100, False, utf8_string, &rt, &fmt, &n, &extra,
-        (unsigned char **)&name);
-    if (i != Success || name == NULL)
-        return False;
-    Client_Name(c, name);
-    XFree(name);
-    return True;
-}
diff --git a/ewmh.h b/ewmh.h
deleted file mode 100644 (file)
index a9fced1..0000000
--- a/ewmh.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * lwm, a window manager for X11
- * Copyright (C) 1997-2016 Elliott Hughes, James Carter
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-/**
- * These are indexes into the ewmh_atom array. Only atoms actually supported
- * by lwm should be included here because _NET_SUPPORTED is built from the
- * ewmh_atom array.
- */
-
-typedef enum {
-/* root window properties */
-       _NET_SUPPORTED,
-       _NET_CLIENT_LIST,
-       _NET_CLIENT_LIST_STACKING,
-       _NET_NUMBER_OF_DESKTOPS,
-       _NET_DESKTOP_GEOMETRY,
-       _NET_DESKTOP_VIEWPORT,
-       _NET_CURRENT_DESKTOP,
-       /*_NET_DESKTOP_NAMES,*/
-       _NET_ACTIVE_WINDOW,
-       _NET_WORKAREA,
-       _NET_SUPPORTING_WM_CHECK,
-       /*_NET_VIRTUAL_ROOTS,*/
-       /*_NET_DESKTOP_LAYOUT,*/
-       /*_NET_SHOWING_DESKTOP,*/
-/* other root window messages */
-       _NET_CLOSE_WINDOW,
-       _NET_MOVERESIZE_WINDOW,
-       _NET_WM_MOVERESIZE,
-/* application window properties */
-       _NET_WM_NAME,
-       /*_NET_WM_VISIBLE_NAME,*/
-       /*_NET_WM_ICON_NAME,*/
-       /*_NET_WM_VISIBLE_ICON_NAME,*/
-       /*_NET_WM_DESKTOP,*/
-       _NET_WM_WINDOW_TYPE,
-       _NET_WM_STATE,
-       _NET_WM_ALLOWED_ACTIONS,
-       _NET_WM_STRUT,
-       /*_NET_WM_ICON_GEOMETRY,*/
-       /*_NET_WM_ICON,*/
-       /*_NET_WM_PID,*/
-       /*_NET_WM_HANDLED_ICONS,*/
-/* window types for _NET_WM_WINDOW_TYPE */
-       _NET_WM_WINDOW_TYPE_DESKTOP,
-       _NET_WM_WINDOW_TYPE_DOCK,
-       _NET_WM_WINDOW_TYPE_TOOLBAR,
-       _NET_WM_WINDOW_TYPE_MENU,
-       _NET_WM_WINDOW_TYPE_UTILITY,
-       _NET_WM_WINDOW_TYPE_SPLASH,
-       _NET_WM_WINDOW_TYPE_DIALOG,
-       _NET_WM_WINDOW_TYPE_NORMAL,
-/* window states for _NET_WM_STATE */
-       /*_NET_WM_STATE_MODAL,*/
-       /*_NET_WM_STATE_STICKY,*/
-       /*_NET_WM_STATE_MAXIMISED_VERT,*/
-       /*_NET_WM_STATE_MAXIMISED_HORZ,*/
-       /*_NET_WM_STATE_SHADED,*/
-       _NET_WM_STATE_SKIP_TASKBAR,
-       _NET_WM_STATE_SKIP_PAGER,
-       _NET_WM_STATE_HIDDEN,
-       _NET_WM_STATE_FULLSCREEN,
-       _NET_WM_STATE_ABOVE,
-       _NET_WM_STATE_BELOW,
-/* allowed actions for _NET_WM_ALLOWED_ACTIONS */
-       _NET_WM_ACTION_MOVE,
-       _NET_WM_ACTION_RESIZE,
-       /*_NET_WM_ACTION_MINIMIZE,*/
-       /*_NET_WM_ACTION_SHADE,*/
-       /*_NET_WM_ACTION_STICK,*/
-       /*_NET_WM_ACTION_MAXIMIZE_HORIZ,*/
-       /*_NET_WM_ACTION_MAXIMIZE_VERT,*/
-       _NET_WM_ACTION_FULLSCREEN,
-       /*_NET_WM_ACTION_CHANGE_DESKTOP,*/
-       _NET_WM_ACTION_CLOSE,
-       EWMH_ATOM_LAST
-} EWMHAtom;
-
diff --git a/lwm.h b/lwm.h
index 2dc96101d0105710f7403a8fb6c279a32e8761bc..5ccfd8ae3ee3f4473f525b9c63a9c64f9c68083b 100644 (file)
--- a/lwm.h
+++ b/lwm.h
@@ -47,7 +47,7 @@ typedef enum {
     ERight,      ENone,   ELeft,
     EBottomLeft, EBottom, EBottomRight,
     E_LAST
-} Edge ;
+} Edge;
 
 /**
 * EWMH direction for _NET_WM_MOVERESIZE
@@ -161,9 +161,3 @@ extern void getWindowName(Client *);
 extern void getNormalHints(Client *);
 extern void manage(Client *, int);
 
-/*  mouse.c */
-extern void getMousePosition(int *, int *);
-
-/*  ewmh.c */
-extern void ewmh_init(void);
-extern Bool ewmh_get_window_name(Client *c);
index 75e54939408808d7fbb315dc7e757fbb1e400f4e..74ef902f054d6ab8fa44eb22cfe9f6e63d222a4d 100644 (file)
--- a/manage.c
+++ b/manage.c
@@ -246,12 +246,9 @@ getWindowName(Client *c) {
         return;
 
     was_nameless = (c->name == 0);
-
-    if (ewmh_get_window_name(c) == False) {
-        if (XGetWindowProperty(dpy, c->window, XA_WM_NAME, 0L, 100L, False, AnyPropertyType, &actual_type, &format, &n, &extra, (unsigned char **) &name) == Success && name && *name != '\0' && n != 0) {
-            Client_Name(c, name);
-            XFree(name);
-        }
+    if (XGetWindowProperty(dpy, c->window, XA_WM_NAME, 0L, 100L, False, AnyPropertyType, &actual_type, &format, &n, &extra, (unsigned char **) &name) == Success && name && *name != '\0' && n != 0) {
+        Client_Name(c, name);
+        XFree(name);
     }
 
     if (!was_nameless)
diff --git a/mouse.c b/mouse.c
deleted file mode 100644 (file)
index f86ac19..0000000
--- a/mouse.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * lwm, a window manager for X11
- * Copyright (C) 1997-2016 Elliott Hughes, James Carter
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <X11/X.h>
-#include <X11/Xos.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-
-#include "lwm.h"
-#include "ewmh.h"
-
-void
-getMousePosition(int * x, int * y) {
-    Window wroot, child;
-    int t1, t2;
-    unsigned int b;
-
-    /* It doesn't matter which root window we give this call. */
-    XQueryPointer(dpy, root, &wroot, &child, x, y, &t1, &t2, &b);
-}
-