[hackers] [swk] remove redundant dc_window function which is in libdc now || Carlos J. Torres

From: <git_AT_suckless.org>
Date: Thu, 04 Apr 2013 10:58:46 +0200

commit 33a2d3992b605071437d5721d1f5c0a0980c925a
Author: Carlos J. Torres <vlaadbrain_AT_gmail.com>
Date: Wed Apr 3 22:38:08 2013 -0400

    remove redundant dc_window function which is in libdc now

diff --git a/gi_x11.c b/gi_x11.c
index f4c5459..2a7bc18 100644
--- a/gi_x11.c
+++ b/gi_x11.c
_AT_@ -7,7 +7,7 @@
 #include <X11/keysym.h>
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
-#include <draw.h>
+#include <dc.h>
 #include "swk.h"
 #define SWK
 #include "config.h"
_AT_@ -23,15 +23,6 @@ static int col[ColorLast];
 static int colors[ColorLast] = { FGCOLOR, BGCOLOR, HICOLOR, TFCOLOR, CCCOLOR };
 #define EVENTMASK PointerMotionMask | ExposureMask | KeyPressMask | ButtonPressMask | ButtonReleaseMask
 
-static Window /* TODO: push into libdraw */
-dc_window(DC *dc, int x, int y, int w, int h) {
- Window window;
- window = XCreateSimpleWindow(dc->dpy, RootWindow(dc->dpy, DefaultScreen(dc->dpy)),
- x, y, w, h, 1, col[ColorBG], col[ColorFG]);
- XSelectInput(dc->dpy, window, EVENTMASK);
- XMapWindow(dc->dpy, window);
- return window;
-}
 static void dc_window_title(Window w, const char *title) {
         XSetStandardProperties(dc->dpy, window, title, NULL, None, NULL, 0, NULL);
 }
_AT_@ -56,6 +47,7 @@ swk_gi_init(SwkWindow *w) {
         dc_font(dc, FONTNAME);
         // TODO: must be dc_window(dc, x, y, w, h, bg, fg)
         window = dc_window(dc, 10, 10, w->r.w, w->r.h);
+ XSelectInput(dc->dpy, window, EVENTMASK);
         dc_window_title(window, w->title);
         return swk_gi_fontsize(0);
 }
Received on Thu Apr 04 2013 - 10:58:46 CEST

This archive was generated by hypermail 2.3.0 : Thu Apr 04 2013 - 11:00:15 CEST