Cleanup following libxcb/xcb-util updates

This commit is contained in:
dcoppa 2014-04-15 10:31:30 +00:00
parent cfe4be35c5
commit 81976900f8
23 changed files with 22 additions and 864 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.74 2014/01/29 08:42:48 dcoppa Exp $
# $OpenBSD: Makefile,v 1.75 2014/04/15 10:32:36 dcoppa Exp $
COMMENT= highly configurable framework window manager
DISTNAME= awesome-3.5.2
REVISION= 3
REVISION= 4
EXTRACT_SUFX= .tar.xz
CATEGORIES= x11
@ -14,13 +14,13 @@ MAINTAINER= David Coppa <dcoppa@openbsd.org>
# GPLv2+
PERMIT_PACKAGE_CDROM= Yes
WANTLIB= X11 X11-xcb Xcursor c cairo dbus-1 \
execinfo gdk_pixbuf-2.0 glib-2.0 \
gobject-2.0 ${MODLUA_WANTLIB} m pthread \
startup-notification-1 xcb xcb-atom \
xcb-aux xcb-event xcb-icccm xcb-keysyms \
xcb-property xcb-randr xcb-render \
xcb-shape xcb-xinerama xcb-xtest xdg-basedir
WANTLIB= X11 c cairo dbus-1 execinfo \
gdk_pixbuf-2.0 glib-2.0 gobject-2.0 \
${MODLUA_WANTLIB} m pthread \
startup-notification-1 xcb xcb-cursor \
xcb-icccm xcb-keysyms xcb-randr \
xcb-render xcb-shape xcb-util \
xcb-xinerama xcb-xtest xdg-basedir
MASTER_SITES= ${HOMEPAGE}download/

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-awesomeConfig_cmake,v 1.12 2013/10/15 09:28:40 dcoppa Exp $
$OpenBSD: patch-awesomeConfig_cmake,v 1.13 2014/04/15 10:32:36 dcoppa Exp $
--- awesomeConfig.cmake.orig Sat Oct 12 18:48:49 2013
+++ awesomeConfig.cmake Tue Oct 15 10:23:15 2013
+++ awesomeConfig.cmake Tue Apr 15 11:42:58 2014
@@ -16,12 +16,11 @@ option(COMPRESS_MANPAGES "compress manpages" ON)
option(GENERATE_DOC "generate API documentation" ON)
@ -42,27 +42,7 @@ $OpenBSD: patch-awesomeConfig_cmake,v 1.12 2013/10/15 09:28:40 dcoppa Exp $
# }}}
# {{{ Check if documentation can be build
@@ -136,14 +131,16 @@ pkg_check_modules(AWESOME_REQUIRED REQUIRED
gdk-pixbuf-2.0
cairo
x11
- xcb-cursor
+ x11-xcb
+ xcursor
xcb-randr
xcb-xtest
xcb-xinerama
xcb-shape
- xcb-util>=0.3.8
+ xcb-aux>=0.3.6
+ xcb-atom>=0.3.6
xcb-keysyms>=0.3.4
- xcb-icccm>=0.3.8
+ xcb-icccm>=0.3.6
cairo-xcb
libstartup-notification-1.0>=0.10
xproto>=7.0.15
@@ -189,7 +186,7 @@ else()
@@ -189,7 +184,7 @@ else()
endif()
# Error check
@ -71,7 +51,7 @@ $OpenBSD: patch-awesomeConfig_cmake,v 1.12 2013/10/15 09:28:40 dcoppa Exp $
message(FATAL_ERROR "lua library not found")
endif()
@@ -257,7 +254,7 @@ endif()
@@ -257,7 +252,7 @@ endif()
if(DEFINED AWESOME_MAN_PATH)
set(AWESOME_MAN_PATH ${AWESOME_MAN_PATH} CACHE PATH "awesome manpage directory")
else()

View File

@ -1,69 +0,0 @@
$OpenBSD: patch-awesome_c,v 1.10 2013/10/15 09:28:41 dcoppa Exp $
Revert to libXcursor
Revert to the old xcb-util-0.3.6 API
--- awesome.c.orig Tue Oct 15 10:18:34 2013
+++ awesome.c Tue Oct 15 10:18:16 2013
@@ -33,6 +33,9 @@
#include <xcb/xtest.h>
#include <xcb/shape.h>
+#include <X11/Xlib-xcb.h>
+#include <X11/XKBlib.h>
+
#include <glib-unix.h>
#include "awesome.h"
@@ -83,7 +86,6 @@ awesome_atexit(bool restart)
xcb_aux_sync(globalconf.connection);
/* Disconnect *after* closing lua */
- xcb_cursor_context_free(globalconf.cursor_ctx);
xcb_disconnect(globalconf.connection);
}
@@ -134,7 +136,7 @@ scan(xcb_query_tree_cookie_t tree_c)
if(!attr_r || attr_r->override_redirect
|| attr_r->map_state == XCB_MAP_STATE_UNMAPPED
- || state == XCB_ICCCM_WM_STATE_WITHDRAWN)
+ || state == XCB_WM_STATE_WITHDRAWN)
{
geom_wins[i] = NULL;
p_delete(&attr_r);
@@ -375,11 +377,21 @@ main(int argc, char **argv)
sigemptyset(&sa.sa_mask);
sigaction(SIGSEGV, &sa, 0);
+ /* XLib sucks */
+ XkbIgnoreExtension(True);
+
+ /* X stuff */
+ globalconf.display = XOpenDisplay(NULL);
+ if (globalconf.display == NULL) {
+ fatal("cannot open display");
+ }
+ XSetEventQueueOwner(globalconf.display, XCBOwnsEventQueue);
+ globalconf.default_screen = XDefaultScreen(globalconf.display);
+ globalconf.connection = XGetXCBConnection(globalconf.display);
/* We have no clue where the input focus is right now */
globalconf.focus.need_update = true;
- /* X stuff */
- globalconf.connection = xcb_connect(NULL, &globalconf.default_screen);
+ /* Double checking that connection is good and operatable with xcb */
if(xcb_connection_has_error(globalconf.connection))
fatal("cannot open display");
@@ -406,9 +418,6 @@ main(int argc, char **argv)
xcb_prefetch_extension_data(globalconf.connection, &xcb_randr_id);
xcb_prefetch_extension_data(globalconf.connection, &xcb_xinerama_id);
xcb_prefetch_extension_data(globalconf.connection, &xcb_shape_id);
-
- if (xcb_cursor_context_new(globalconf.connection, globalconf.screen, &globalconf.cursor_ctx) < 0)
- fatal("Failed to initialize xcb-cursor");
/* Setup the main context */
g_main_context_set_poll_func(g_main_context_default(), &a_glib_poll);

View File

@ -1,36 +0,0 @@
$OpenBSD: patch-common_xcursor_c,v 1.1 2013/10/15 09:28:42 dcoppa Exp $
Revert to libXcursor
--- common/xcursor.c.orig Sat Oct 12 18:48:49 2013
+++ common/xcursor.c Tue Oct 15 10:18:16 2013
@@ -22,8 +22,6 @@
#include "common/xcursor.h"
#include "common/util.h"
-#include <X11/cursorfont.h>
-
static char const * const xcursor_font[] =
{
[XC_X_cursor] = "X_cursor",
@@ -131,17 +129,17 @@ xcursor_font_tostr(uint16_t c)
/** Equivalent to 'XCreateFontCursor()', error are handled by the
* default current error handler.
- * \param ctx The xcb-cursor context.
+ * \param conn The connection to the X server.
* \param cursor_font Type of cursor to use.
* \return Allocated cursor font.
*/
xcb_cursor_t
-xcursor_new(xcb_cursor_context_t *ctx, uint16_t cursor_font)
+xcursor_new(Display *conn, uint16_t cursor_font)
{
static xcb_cursor_t xcursor[countof(xcursor_font)];
if (!xcursor[cursor_font]) {
- xcursor[cursor_font] = xcb_cursor_load_cursor(ctx, xcursor_font_tostr(cursor_font));
+ xcursor[cursor_font] = XcursorLibraryLoadCursor(conn, xcursor_font_tostr(cursor_font));
}
return xcursor[cursor_font];

View File

@ -1,23 +0,0 @@
$OpenBSD: patch-common_xcursor_h,v 1.1 2013/10/15 09:28:42 dcoppa Exp $
Revert to libXcursor
--- common/xcursor.h.orig Sat Oct 12 18:48:49 2013
+++ common/xcursor.h Tue Oct 15 10:18:16 2013
@@ -22,12 +22,14 @@
#ifndef AWESOME_COMMON_XCURSORS_H
#define AWESOME_COMMON_XCURSORS_H
+#include <X11/cursorfont.h>
#include <xcb/xcb.h>
-#include <xcb/xcb_cursor.h>
+#include <X11/Xcursor/Xcursor.h>
+
uint16_t xcursor_font_fromstr(const char *);
const char * xcursor_font_tostr(uint16_t);
-xcb_cursor_t xcursor_new(xcb_cursor_context_t *, uint16_t);
+xcb_cursor_t xcursor_new(Display *, uint16_t);
#endif
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80

View File

@ -1,14 +0,0 @@
$OpenBSD: patch-common_xutil_c,v 1.1 2011/11/30 11:50:58 dcoppa Exp $
Revert to the old xcb-util-0.3.6 API
--- common/xutil.c.orig Wed Nov 23 15:08:50 2011
+++ common/xutil.c Wed Nov 30 10:55:11 2011
@@ -25,6 +25,7 @@
#include "common/util.h"
#include <xcb/xcb.h>
+#include <xcb/xcb_atom.h>
#include <xcb/xcb_icccm.h>
#include "common/xutil.h"

View File

@ -1,24 +0,0 @@
$OpenBSD: patch-event_c,v 1.5 2013/10/15 09:28:42 dcoppa Exp $
Revert to the old xcb-util-0.3.6 API
--- event.c.orig Sat Oct 12 18:48:49 2013
+++ event.c Tue Oct 15 10:01:42 2013
@@ -321,7 +321,7 @@ event_handle_configurerequest(xcb_configure_request_ev
}
/* If the client resizes without moving itself, apply window gravity */
- if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_WIN_GRAVITY)
+ if(c->size_hints.flags & XCB_SIZE_HINT_P_WIN_GRAVITY)
{
int16_t diff_x = 0, diff_y = 0;
xwindow_translate_for_gravity(c->size_hints.win_gravity, diff_border, diff_border, diff_w, diff_h, &diff_x, &diff_y);
@@ -701,7 +701,7 @@ event_handle_clientmessage(xcb_client_message_event_t
client_t *c;
if((c = client_getbywin(ev->window))
&& ev->format == 32
- && ev->data.data32[0] == XCB_ICCCM_WM_STATE_ICONIC)
+ && ev->data.data32[0] == XCB_WM_STATE_ICONIC)
{
luaA_object_push(globalconf.L, c);
client_set_minimized(globalconf.L, -1, true);

View File

@ -1,29 +0,0 @@
$OpenBSD: patch-globalconf_h,v 1.4 2013/10/15 09:28:42 dcoppa Exp $
Revert to libXcursor
--- globalconf.h.orig Sat Oct 12 18:48:49 2013
+++ globalconf.h Tue Oct 15 10:18:16 2013
@@ -29,7 +29,6 @@
#include <xcb/xcb_icccm.h>
#include <xcb/xcb_keysyms.h>
-#include <xcb/xcb_cursor.h>
#include "objects/key.h"
#include "color.h"
@@ -65,12 +64,12 @@ ARRAY_TYPE(drawin_t *, drawin)
/** Main configuration structure */
typedef struct
{
+ /** Xlib Display */
+ Display * display;
/** Connection ref */
xcb_connection_t *connection;
/** Default screen number */
int default_screen;
- /** xcb-cursor context */
- xcb_cursor_context_t *cursor_ctx;
/** Keys symbol table */
xcb_key_symbols_t *keysyms;
/** Logical screens */

View File

@ -1,15 +0,0 @@
$OpenBSD: patch-mousegrabber_c,v 1.1 2013/10/15 09:28:46 dcoppa Exp $
Revert to libXcursor
--- mousegrabber.c.orig Sat Oct 12 18:48:49 2013
+++ mousegrabber.c Tue Oct 15 10:18:16 2013
@@ -94,7 +94,7 @@ luaA_mousegrabber_run(lua_State *L)
if(cfont)
{
- xcb_cursor_t cursor = xcursor_new(globalconf.cursor_ctx, cfont);
+ xcb_cursor_t cursor = xcursor_new(globalconf.display, cfont);
luaA_registerfct(L, 1, &globalconf.mousegrabber);

View File

@ -1,208 +0,0 @@
$OpenBSD: patch-objects_client_c,v 1.7 2013/10/15 09:28:46 dcoppa Exp $
Revert to the old xcb-util-0.3.6 API
--- objects/client.c.orig Sat Oct 12 18:48:49 2013
+++ objects/client.c Tue Oct 15 09:51:13 2013
@@ -45,7 +45,7 @@ static void
client_wipe(client_t *c)
{
key_array_wipe(&c->keys);
- xcb_icccm_get_wm_protocols_reply_wipe(&c->protocols);
+ xcb_get_wm_protocols_reply_wipe(&c->protocols);
p_delete(&c->machine);
p_delete(&c->class);
p_delete(&c->instance);
@@ -70,20 +70,20 @@ client_set_urgent(lua_State *L, int cidx, bool urgent)
if(c->urgent != urgent)
{
xcb_get_property_cookie_t hints =
- xcb_icccm_get_wm_hints_unchecked(globalconf.connection, c->window);
+ xcb_get_wm_hints_unchecked(globalconf.connection, c->window);
c->urgent = urgent;
/* update ICCCM hints */
- xcb_icccm_wm_hints_t wmh;
- xcb_icccm_get_wm_hints_reply(globalconf.connection, hints, &wmh, NULL);
+ xcb_wm_hints_t wmh;
+ xcb_get_wm_hints_reply(globalconf.connection, hints, &wmh, NULL);
if(urgent)
- wmh.flags |= XCB_ICCCM_WM_HINT_X_URGENCY;
+ wmh.flags |= XCB_WM_HINT_X_URGENCY;
else
- wmh.flags &= ~XCB_ICCCM_WM_HINT_X_URGENCY;
+ wmh.flags &= ~XCB_WM_HINT_X_URGENCY;
- xcb_icccm_set_wm_hints(globalconf.connection, c->window, &wmh);
+ xcb_set_wm_hints(globalconf.connection, c->window, &wmh);
luaA_object_emit_signal(L, cidx, "property::urgent", 0);
}
@@ -565,7 +565,7 @@ HANDLE_GEOM(height)
*
* At this stage it's just safer to keep it in normal state and avoid confusion.
*/
- xwindow_set_state(c->window, XCB_ICCCM_WM_STATE_NORMAL);
+ xwindow_set_state(c->window, XCB_WM_STATE_NORMAL);
if(!startup)
{
@@ -637,26 +637,26 @@ client_apply_size_hints(client_t *c, area_t geometry)
/* Size hints are applied to the window without any decoration */
client_remove_titlebar_geometry(c, &geometry);
- if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_SIZE)
+ if(c->size_hints.flags & XCB_SIZE_HINT_P_SIZE)
{
basew = c->size_hints.base_width;
baseh = c->size_hints.base_height;
real_basew = basew;
real_baseh = baseh;
}
- else if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_MIN_SIZE)
+ else if(c->size_hints.flags & XCB_SIZE_HINT_P_MIN_SIZE)
{
/* base size is substituted with min size if not specified */
basew = c->size_hints.min_width;
baseh = c->size_hints.min_height;
}
- if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_MIN_SIZE)
+ if(c->size_hints.flags & XCB_SIZE_HINT_P_MIN_SIZE)
{
minw = c->size_hints.min_width;
minh = c->size_hints.min_height;
}
- else if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_SIZE)
+ else if(c->size_hints.flags & XCB_SIZE_HINT_P_SIZE)
{
/* min size is substituted with base size if not specified */
minw = c->size_hints.base_width;
@@ -664,7 +664,7 @@ client_apply_size_hints(client_t *c, area_t geometry)
}
/* Handle the size aspect ratio */
- if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_ASPECT
+ if(c->size_hints.flags & XCB_SIZE_HINT_P_ASPECT
&& c->size_hints.min_aspect_den > 0
&& c->size_hints.max_aspect_den > 0
&& geometry.height > real_baseh
@@ -705,7 +705,7 @@ client_apply_size_hints(client_t *c, area_t geometry)
geometry.height = MAX(geometry.height, minh);
/* Handle the maximum size */
- if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_MAX_SIZE)
+ if(c->size_hints.flags & XCB_SIZE_HINT_P_MAX_SIZE)
{
if(c->size_hints.max_width)
geometry.width = MIN(geometry.width, c->size_hints.max_width);
@@ -714,7 +714,7 @@ client_apply_size_hints(client_t *c, area_t geometry)
}
/* Handle the size increment */
- if(c->size_hints.flags & (XCB_ICCCM_SIZE_HINT_P_RESIZE_INC | XCB_ICCCM_SIZE_HINT_BASE_SIZE)
+ if(c->size_hints.flags & (XCB_SIZE_HINT_P_RESIZE_INC | XCB_SIZE_HINT_BASE_SIZE)
&& c->size_hints.width_inc && c->size_hints.height_inc)
{
uint16_t t1 = geometry.width, t2 = geometry.height;
@@ -896,9 +896,9 @@ client_set_minimized(lua_State *L, int cidx, bool s)
c->minimized = s;
banning_need_update();
if(s)
- xwindow_set_state(c->window, XCB_ICCCM_WM_STATE_ICONIC);
+ xwindow_set_state(c->window, XCB_WM_STATE_ICONIC);
else
- xwindow_set_state(c->window, XCB_ICCCM_WM_STATE_NORMAL);
+ xwindow_set_state(c->window, XCB_WM_STATE_NORMAL);
if(strut_has_value(&c->strut))
screen_emit_signal(globalconf.L, c->screen, "property::workarea", 0);
luaA_object_emit_signal(L, cidx, "property::minimized", 0);
@@ -1201,7 +1201,7 @@ client_unmanage(client_t *c, bool window_valid)
/* Do this last to avoid races with clients. According to ICCCM, clients
* arent allowed to re-use the window until after this. */
- xwindow_set_state(c->window, XCB_ICCCM_WM_STATE_WITHDRAWN);
+ xwindow_set_state(c->window, XCB_WM_STATE_WITHDRAWN);
}
/* set client as invalid */
@@ -1856,9 +1856,9 @@ luaA_client_get_size_hints(lua_State *L, client_t *c)
lua_createtable(L, 0, 1);
- if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_US_POSITION)
+ if(c->size_hints.flags & XCB_SIZE_HINT_US_POSITION)
u_or_p = "user_position";
- else if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_POSITION)
+ else if(c->size_hints.flags & XCB_SIZE_HINT_P_POSITION)
u_or_p = "program_position";
if(u_or_p)
@@ -1872,9 +1872,9 @@ luaA_client_get_size_hints(lua_State *L, client_t *c)
u_or_p = NULL;
}
- if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_US_SIZE)
+ if(c->size_hints.flags & XCB_SIZE_HINT_US_SIZE)
u_or_p = "user_size";
- else if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_SIZE)
+ else if(c->size_hints.flags & XCB_SIZE_HINT_P_SIZE)
u_or_p = "program_size";
if(u_or_p)
@@ -1887,7 +1887,7 @@ luaA_client_get_size_hints(lua_State *L, client_t *c)
lua_setfield(L, -2, u_or_p);
}
- if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_MIN_SIZE)
+ if(c->size_hints.flags & XCB_SIZE_HINT_P_MIN_SIZE)
{
lua_pushnumber(L, c->size_hints.min_width);
lua_setfield(L, -2, "min_width");
@@ -1895,7 +1895,7 @@ luaA_client_get_size_hints(lua_State *L, client_t *c)
lua_setfield(L, -2, "min_height");
}
- if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_MAX_SIZE)
+ if(c->size_hints.flags & XCB_SIZE_HINT_P_MAX_SIZE)
{
lua_pushnumber(L, c->size_hints.max_width);
lua_setfield(L, -2, "max_width");
@@ -1903,7 +1903,7 @@ luaA_client_get_size_hints(lua_State *L, client_t *c)
lua_setfield(L, -2, "max_height");
}
- if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_RESIZE_INC)
+ if(c->size_hints.flags & XCB_SIZE_HINT_P_RESIZE_INC)
{
lua_pushnumber(L, c->size_hints.width_inc);
lua_setfield(L, -2, "width_inc");
@@ -1911,7 +1911,7 @@ luaA_client_get_size_hints(lua_State *L, client_t *c)
lua_setfield(L, -2, "height_inc");
}
- if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_ASPECT)
+ if(c->size_hints.flags & XCB_SIZE_HINT_P_ASPECT)
{
lua_pushnumber(L, c->size_hints.min_aspect_num);
lua_setfield(L, -2, "min_aspect_num");
@@ -1923,7 +1923,7 @@ luaA_client_get_size_hints(lua_State *L, client_t *c)
lua_setfield(L, -2, "max_aspect_den");
}
- if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_BASE_SIZE)
+ if(c->size_hints.flags & XCB_SIZE_HINT_BASE_SIZE)
{
lua_pushnumber(L, c->size_hints.base_width);
lua_setfield(L, -2, "base_width");
@@ -1931,7 +1931,7 @@ luaA_client_get_size_hints(lua_State *L, client_t *c)
lua_setfield(L, -2, "base_height");
}
- if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_WIN_GRAVITY)
+ if(c->size_hints.flags & XCB_SIZE_HINT_P_WIN_GRAVITY)
{
switch(c->size_hints.win_gravity)
{

View File

@ -1,26 +0,0 @@
$OpenBSD: patch-objects_client_h,v 1.3 2013/10/15 09:28:46 dcoppa Exp $
Revert to the old xcb-util-0.3.6 API
--- objects/client.h.orig Sat Oct 12 18:48:49 2013
+++ objects/client.h Tue Oct 15 09:51:13 2013
@@ -99,7 +99,7 @@ struct client_t
/** Window holding command needed to start it (session management related) */
xcb_window_t leader_window;
/** Client's WM_PROTOCOLS property */
- xcb_icccm_get_wm_protocols_reply_t protocols;
+ xcb_get_wm_protocols_reply_t protocols;
/** Key bindings */
key_array_t keys;
/** Icon */
@@ -212,8 +212,8 @@ client_raise(client_t *c)
static inline bool
client_isfixed(client_t *c)
{
- return (c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_MAX_SIZE
- && c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_MIN_SIZE
+ return (c->size_hints.flags & XCB_SIZE_HINT_P_MAX_SIZE
+ && c->size_hints.flags & XCB_SIZE_HINT_P_MIN_SIZE
&& c->size_hints.max_width == c->size_hints.min_width
&& c->size_hints.max_height == c->size_hints.min_height
&& c->size_hints.max_width

View File

@ -1,6 +1,4 @@
$OpenBSD: patch-objects_drawin_c,v 1.2 2014/01/14 13:33:37 dcoppa Exp $
Revert to libXcursor
$OpenBSD: patch-objects_drawin_c,v 1.3 2014/04/15 10:32:36 dcoppa Exp $
Fix a bug in luaA_drawin_set_shape_bounding() which forgot to include
the drawin's border in its size calculation
@ -8,24 +6,6 @@ the drawin's border in its size calculation
--- objects/drawin.c.orig Sat Oct 12 18:48:49 2013
+++ objects/drawin.c Tue Jan 14 10:36:22 2014
@@ -142,7 +142,7 @@ drawin_init(drawin_t *w)
| XCB_EVENT_MASK_POINTER_MOTION | XCB_EVENT_MASK_EXPOSURE
| XCB_EVENT_MASK_PROPERTY_CHANGE,
globalconf.default_cmap,
- xcursor_new(globalconf.cursor_ctx, xcursor_font_fromstr(w->cursor))
+ xcursor_new(globalconf.display, xcursor_font_fromstr(w->cursor))
});
/* Set the right properties */
@@ -502,7 +502,7 @@ luaA_drawin_set_cursor(lua_State *L, drawin_t *drawin)
uint16_t cursor_font = xcursor_font_fromstr(buf);
if(cursor_font)
{
- xcb_cursor_t cursor = xcursor_new(globalconf.cursor_ctx, cursor_font);
+ xcb_cursor_t cursor = xcursor_new(globalconf.display, cursor_font);
p_delete(&drawin->cursor);
drawin->cursor = a_strdup(buf);
xwindow_set_cursor(drawin->window, cursor);
@@ -547,7 +547,9 @@ luaA_drawin_set_shape_bounding(lua_State *L, drawin_t
cairo_surface_t *surf = NULL;
if(!lua_isnil(L, -1))

View File

@ -1,6 +1,4 @@
$OpenBSD: patch-property_c,v 1.6 2014/01/14 13:33:37 dcoppa Exp $
Revert to the old xcb-util-0.3.6 API
$OpenBSD: patch-property_c,v 1.7 2014/04/15 10:32:36 dcoppa Exp $
commit 389a54e356f700a4f2a621e05dbdbafab4a3a03a
Author: Uli Schlachter <psychon@znc.in>
@ -24,24 +22,6 @@ Signed-off-by: Uli Schlachter <psychon@znc.in>
--- property.c.orig Sat Oct 12 18:48:49 2013
+++ property.c Tue Jan 14 10:21:57 2014
@@ -98,7 +98,7 @@ HANDLE_PROPERTY(net_wm_pid)
xcb_get_property_cookie_t
property_get_wm_transient_for(client_t *c)
{
- return xcb_icccm_get_wm_transient_for_unchecked(globalconf.connection, c->window);
+ return xcb_get_wm_transient_for_unchecked(globalconf.connection, c->window);
}
void
@@ -108,7 +108,7 @@ property_update_wm_transient_for(client_t *c, xcb_get_
int counter;
client_t *tc, *tmp;
- if(!xcb_icccm_get_wm_transient_for_reply(globalconf.connection,
+ if(!xcb_get_wm_transient_for_reply(globalconf.connection,
cookie,
&trans, NULL))
return;
@@ -119,9 +119,14 @@ property_update_wm_transient_for(client_t *c, xcb_get_
client_set_type(globalconf.L, -1, WINDOW_TYPE_DIALOG);
client_set_above(globalconf.L, -1, false);
@ -58,114 +38,3 @@ Signed-off-by: Uli Schlachter <psychon@znc.in>
if (counter <= globalconf.stack.len)
client_set_transient_for(globalconf.L, -1, tc);
@@ -156,7 +161,7 @@ property_update_wm_client_leader(client_t *c, xcb_get_
xcb_get_property_cookie_t
property_get_wm_normal_hints(client_t *c)
{
- return xcb_icccm_get_wm_normal_hints_unchecked(globalconf.connection, c->window);
+ return xcb_get_wm_normal_hints_unchecked(globalconf.connection, c->window);
}
/** Update the size hints of a client.
@@ -166,7 +171,7 @@ property_get_wm_normal_hints(client_t *c)
void
property_update_wm_normal_hints(client_t *c, xcb_get_property_cookie_t cookie)
{
- xcb_icccm_get_wm_normal_hints_reply(globalconf.connection,
+ xcb_get_wm_normal_hints_reply(globalconf.connection,
cookie,
&c->size_hints, NULL);
}
@@ -174,7 +179,7 @@ property_update_wm_normal_hints(client_t *c, xcb_get_p
xcb_get_property_cookie_t
property_get_wm_hints(client_t *c)
{
- return xcb_icccm_get_wm_hints_unchecked(globalconf.connection, c->window);
+ return xcb_get_wm_hints_unchecked(globalconf.connection, c->window);
}
/** Update the WM hints of a client.
@@ -184,20 +189,20 @@ property_get_wm_hints(client_t *c)
void
property_update_wm_hints(client_t *c, xcb_get_property_cookie_t cookie)
{
- xcb_icccm_wm_hints_t wmh;
+ xcb_wm_hints_t wmh;
- if(!xcb_icccm_get_wm_hints_reply(globalconf.connection,
+ if(!xcb_get_wm_hints_reply(globalconf.connection,
cookie,
&wmh, NULL))
return;
luaA_object_push(globalconf.L, c);
- client_set_urgent(globalconf.L, -1, xcb_icccm_wm_hints_get_urgency(&wmh));
+ client_set_urgent(globalconf.L, -1, xcb_wm_hints_get_urgency(&wmh));
- if(wmh.flags & XCB_ICCCM_WM_HINT_INPUT)
+ if(wmh.flags & XCB_WM_HINT_INPUT)
c->nofocus = !wmh.input;
- if(wmh.flags & XCB_ICCCM_WM_HINT_WINDOW_GROUP)
+ if(wmh.flags & XCB_WM_HINT_WINDOW_GROUP)
client_set_group_window(globalconf.L, -1, wmh.window_group);
lua_pop(globalconf.L, 1);
@@ -206,7 +211,7 @@ property_update_wm_hints(client_t *c, xcb_get_property
xcb_get_property_cookie_t
property_get_wm_class(client_t *c)
{
- return xcb_icccm_get_wm_class_unchecked(globalconf.connection, c->window);
+ return xcb_get_wm_class_unchecked(globalconf.connection, c->window);
}
/** Update WM_CLASS of a client.
@@ -216,9 +221,9 @@ property_get_wm_class(client_t *c)
void
property_update_wm_class(client_t *c, xcb_get_property_cookie_t cookie)
{
- xcb_icccm_get_wm_class_reply_t hint;
+ xcb_get_wm_class_reply_t hint;
- if(!xcb_icccm_get_wm_class_reply(globalconf.connection,
+ if(!xcb_get_wm_class_reply(globalconf.connection,
cookie,
&hint, NULL))
return;
@@ -227,7 +232,7 @@ property_update_wm_class(client_t *c, xcb_get_property
client_set_class_instance(globalconf.L, -1, hint.class_name, hint.instance_name);
lua_pop(globalconf.L, 1);
- xcb_icccm_get_wm_class_reply_wipe(&hint);
+ xcb_get_wm_class_reply_wipe(&hint);
}
static int
@@ -290,7 +295,7 @@ property_update_net_wm_pid(client_t *c, xcb_get_proper
xcb_get_property_cookie_t
property_get_wm_protocols(client_t *c)
{
- return xcb_icccm_get_wm_protocols_unchecked(globalconf.connection,
+ return xcb_get_wm_protocols_unchecked(globalconf.connection,
c->window, WM_PROTOCOLS);
}
@@ -301,15 +306,15 @@ property_get_wm_protocols(client_t *c)
void
property_update_wm_protocols(client_t *c, xcb_get_property_cookie_t cookie)
{
- xcb_icccm_get_wm_protocols_reply_t protocols;
+ xcb_get_wm_protocols_reply_t protocols;
/* If this fails for any reason, we still got the old value */
- if(!xcb_icccm_get_wm_protocols_reply(globalconf.connection,
+ if(!xcb_get_wm_protocols_reply(globalconf.connection,
cookie,
&protocols, NULL))
return;
- xcb_icccm_get_wm_protocols_reply_wipe(&c->protocols);
+ xcb_get_wm_protocols_reply_wipe(&c->protocols);
memcpy(&c->protocols, &protocols, sizeof(protocols));
}

View File

@ -1,15 +0,0 @@
$OpenBSD: patch-root_c,v 1.1 2013/10/15 09:28:47 dcoppa Exp $
Revert to libXcursor
--- root.c.orig Sat Oct 12 18:48:49 2013
+++ root.c Tue Oct 15 10:18:16 2013
@@ -303,7 +303,7 @@ luaA_root_cursor(lua_State *L)
if(cursor_font)
{
- uint32_t change_win_vals[] = { xcursor_new(globalconf.cursor_ctx, cursor_font) };
+ uint32_t change_win_vals[] = { xcursor_new(globalconf.display, cursor_font) };
xcb_change_window_attributes(globalconf.connection,
globalconf.screen->root,

View File

@ -1,29 +0,0 @@
$OpenBSD: patch-selection_c,v 1.2 2013/05/22 15:05:50 dcoppa Exp $
Revert to the old xcb-util-0.3.6 API
--- selection.c.orig Mon May 20 13:45:32 2013
+++ selection.c Mon May 20 13:45:55 2013
@@ -86,18 +86,18 @@ luaA_selection_get(lua_State *L)
if(event_notify->selection == XCB_ATOM_PRIMARY
&& event_notify->property != XCB_NONE)
{
- xcb_icccm_get_text_property_reply_t prop;
+ xcb_get_text_property_reply_t prop;
xcb_get_property_cookie_t cookie =
- xcb_icccm_get_text_property(globalconf.connection,
+ xcb_get_text_property(globalconf.connection,
event_notify->requestor,
event_notify->property);
- if(xcb_icccm_get_text_property_reply(globalconf.connection,
+ if(xcb_get_text_property_reply(globalconf.connection,
cookie, &prop, NULL))
{
lua_pushlstring(L, prop.name, prop.name_len);
- xcb_icccm_get_text_property_reply_wipe(&prop);
+ xcb_get_text_property_reply_wipe(&prop);
xcb_delete_property(globalconf.connection,
event_notify->requestor,

View File

@ -1,15 +0,0 @@
$OpenBSD: patch-systray_c,v 1.2 2013/05/22 15:05:50 dcoppa Exp $
Revert to the old xcb-util-0.3.6 API
--- systray.c.orig Mon May 20 13:46:18 2013
+++ systray.c Mon May 20 13:46:38 2013
@@ -164,7 +164,7 @@ systray_request_handle(xcb_window_t embed_win, xembed_
xcb_change_window_attributes(globalconf.connection, embed_win, XCB_CW_EVENT_MASK,
select_input_val);
- xwindow_set_state(embed_win, XCB_ICCCM_WM_STATE_WITHDRAWN);
+ xwindow_set_state(embed_win, XCB_WM_STATE_WITHDRAWN);
/* we grab the window, but also make sure it's automatically reparented back
* to the root window if we should die.

View File

@ -1,15 +0,0 @@
$OpenBSD: patch-xwindow_c,v 1.4 2013/10/15 09:28:47 dcoppa Exp $
Revert to the old xcb-util-0.3.6 API
--- xwindow.c.orig Mon Apr 1 13:44:46 2013
+++ xwindow.c Fri May 24 16:58:00 2013
@@ -62,7 +62,7 @@ uint32_t
xwindow_get_state_reply(xcb_get_property_cookie_t cookie)
{
/* If no property is set, we just assume a sane default. */
- uint32_t result = XCB_ICCCM_WM_STATE_NORMAL;
+ uint32_t result = XCB_WM_STATE_NORMAL;
xcb_get_property_reply_t *prop_r;
if((prop_r = xcb_get_property_reply(globalconf.connection, cookie, NULL)))

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.84 2014/04/14 19:52:44 matthieu Exp $
# $OpenBSD: Makefile,v 1.85 2014/04/15 10:31:30 dcoppa Exp $
COMMENT = improved dynamic tiling window manager
DISTNAME = i3-4.7.2
REVISION = 5
REVISION = 6
CATEGORIES = x11
EXTRACT_SUFX = .tar.bz2
@ -14,11 +14,11 @@ MAINTAINER = David Coppa <dcoppa@openbsd.org>
# BSD
PERMIT_PACKAGE_CDROM = Yes
WANTLIB = X11 Xcursor c>=68.3 cairo ev fontconfig freetype \
WANTLIB = X11 c>=68.3 cairo ev fontconfig freetype \
glib-2.0 gobject-2.0 m pango-1.0 pangocairo-1.0 \
pangoft2-1.0 pcre pthread startup-notification-1 \
xcb xcb-util xcb-icccm xcb-keysyms xcb-randr xcb-xinerama \
yajl z
xcb xcb-cursor xcb-util xcb-icccm xcb-keysyms \
xcb-randr xcb-xinerama yajl z
MODULES = devel/gettext

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-common_mk,v 1.18 2014/03/26 07:02:34 ajacoutot Exp $
$OpenBSD: patch-common_mk,v 1.19 2014/04/15 10:31:30 dcoppa Exp $
--- common.mk.orig Thu Jan 23 22:52:24 2014
+++ common.mk Mon Mar 24 08:15:17 2014
+++ common.mk Tue Apr 15 07:55:02 2014
@@ -1,5 +1,5 @@
UNAME=$(shell uname)
-DEBUG=1
@ -8,17 +8,6 @@ $OpenBSD: patch-common_mk,v 1.18 2014/03/26 07:02:34 ajacoutot Exp $
COVERAGE=0
INSTALL=install
LN=ln
@@ -110,8 +110,8 @@ X11_CFLAGS := $(call cflags_for_lib, x11)
X11_LIBS := $(call ldflags_for_lib, x11,X11)
# Xcursor
-XCURSOR_CFLAGS := $(call cflags_for_lib, xcb-cursor)
-XCURSOR_LIBS := $(call ldflags_for_lib, xcb-cursor,xcb-cursor)
+XCURSOR_CFLAGS := $(call cflags_for_lib, xcursor)
+XCURSOR_LIBS := $(call ldflags_for_lib, xcursor,Xcursor)
# yajl
YAJL_CFLAGS := $(call cflags_for_lib, yajl)
@@ -160,9 +160,9 @@ I3_LDFLAGS += -Wl,-rpath,/usr/local/lib -Wl,-rpath,/us
endif

View File

@ -1,17 +0,0 @@
$OpenBSD: patch-i3bar_include_xcb_h,v 1.1 2013/05/16 18:42:30 dcoppa Exp $
Fix for our uncommon setup: up-to-date libxcb, but older xcb-util.
--- i3bar/include/xcb.h.orig Mon May 13 18:05:49 2013
+++ i3bar/include/xcb.h Mon May 13 18:05:58 2013
@@ -13,10 +13,6 @@
#include <stdint.h>
//#include "outputs.h"
-#ifdef XCB_COMPAT
-#define XCB_ATOM_CARDINAL CARDINAL
-#endif
-
#define _NET_SYSTEM_TRAY_ORIENTATION_HORZ 0
#define _NET_SYSTEM_TRAY_ORIENTATION_VERT 1
#define SYSTEM_TRAY_REQUEST_DOCK 0

View File

@ -1,24 +0,0 @@
$OpenBSD: patch-include_xcursor_h,v 1.3 2014/01/11 16:04:43 dcoppa Exp $
Revert to libXcursor
--- include/xcursor.h.orig Sun Dec 22 21:12:41 2013
+++ include/xcursor.h Fri Jan 10 16:43:33 2014
@@ -10,7 +10,7 @@
#ifndef I3_XCURSOR_CURSOR_H
#define I3_XCURSOR_CURSOR_H
-#include <xcb/xcb_cursor.h>
+#include <X11/Xlib.h>
enum xcursor_cursor_t {
XCURSOR_CURSOR_POINTER = 0,
@@ -26,7 +26,7 @@ enum xcursor_cursor_t {
};
void xcursor_load_cursors(void);
-xcb_cursor_t xcursor_get_cursor(enum xcursor_cursor_t c);
+Cursor xcursor_get_cursor(enum xcursor_cursor_t c);
int xcursor_get_xcb_cursor(enum xcursor_cursor_t c);
/**

View File

@ -1,15 +0,0 @@
$OpenBSD: patch-src_floating_c,v 1.19 2014/01/11 16:04:43 dcoppa Exp $
Revert to libXcursor
--- src/floating.c.orig Sun Dec 22 21:12:41 2013
+++ src/floating.c Fri Jan 10 16:40:03 2014
@@ -583,7 +583,7 @@ drag_result_t drag_pointer(Con *con, const xcb_button_
if (con != NULL)
memcpy(&old_rect, &(con->rect), sizeof(Rect));
- xcb_cursor_t xcursor = (cursor && xcursor_supported) ?
+ Cursor xcursor = (cursor && xcursor_supported) ?
xcursor_get_cursor(cursor) : XCB_NONE;
/* Grab the pointer */

View File

@ -1,86 +0,0 @@
$OpenBSD: patch-src_xcursor_c,v 1.1 2014/01/11 16:04:43 dcoppa Exp $
Revert to libXcursor
--- src/xcursor.c.orig Sun Dec 22 21:12:41 2013
+++ src/xcursor.c Fri Jan 10 18:00:16 2014
@@ -10,14 +10,14 @@
*
*/
#include <assert.h>
-#include <xcb/xcb_cursor.h>
+#include <X11/Xcursor/Xcursor.h>
+#include <X11/cursorfont.h>
#include "i3.h"
#include "xcb.h"
#include "xcursor.h"
-static xcb_cursor_context_t *ctx;
-static xcb_cursor_t cursors[XCURSOR_CURSOR_MAX];
+static Cursor cursors[XCURSOR_CURSOR_MAX];
static const int xcb_cursors[XCURSOR_CURSOR_MAX] = {
XCB_CURSOR_LEFT_PTR,
@@ -26,28 +26,27 @@ static const int xcb_cursors[XCURSOR_CURSOR_MAX] = {
XCB_CURSOR_WATCH
};
-void xcursor_load_cursors(void) {
- if (xcb_cursor_context_new(conn, root_screen, &ctx) < 0) {
+static Cursor load_cursor(const char *name) {
+ Cursor c = XcursorLibraryLoadCursor(xlibdpy, name);
+ if (c == None) {
ELOG("xcursor support unavailable\n");
xcursor_supported = false;
- return;
}
-#define LOAD_CURSOR(constant, name) \
- do { \
- cursors[constant] = xcb_cursor_load_cursor(ctx, name); \
- } while (0)
- LOAD_CURSOR(XCURSOR_CURSOR_POINTER, "left_ptr");
- LOAD_CURSOR(XCURSOR_CURSOR_RESIZE_HORIZONTAL, "sb_h_double_arrow");
- LOAD_CURSOR(XCURSOR_CURSOR_RESIZE_VERTICAL, "sb_v_double_arrow");
- LOAD_CURSOR(XCURSOR_CURSOR_WATCH, "watch");
- LOAD_CURSOR(XCURSOR_CURSOR_MOVE, "fleur");
- LOAD_CURSOR(XCURSOR_CURSOR_TOP_LEFT_CORNER, "top_left_corner");
- LOAD_CURSOR(XCURSOR_CURSOR_TOP_RIGHT_CORNER, "top_right_corner");
- LOAD_CURSOR(XCURSOR_CURSOR_BOTTOM_LEFT_CORNER, "bottom_left_corner");
- LOAD_CURSOR(XCURSOR_CURSOR_BOTTOM_RIGHT_CORNER, "bottom_right_corner");
-#undef LOAD_CURSOR
+ return c;
}
+void xcursor_load_cursors(void) {
+ cursors[XCURSOR_CURSOR_POINTER] = load_cursor("left_ptr");
+ cursors[XCURSOR_CURSOR_RESIZE_HORIZONTAL] = load_cursor("sb_h_double_arrow");
+ cursors[XCURSOR_CURSOR_RESIZE_VERTICAL] = load_cursor("sb_v_double_arrow");
+ cursors[XCURSOR_CURSOR_WATCH] = load_cursor("watch");
+ cursors[XCURSOR_CURSOR_MOVE] = load_cursor("fleur");
+ cursors[XCURSOR_CURSOR_TOP_LEFT_CORNER] = load_cursor("top_left_corner");
+ cursors[XCURSOR_CURSOR_TOP_RIGHT_CORNER] = load_cursor("top_right_corner");
+ cursors[XCURSOR_CURSOR_BOTTOM_LEFT_CORNER] = load_cursor("bottom_left_corner");
+ cursors[XCURSOR_CURSOR_BOTTOM_RIGHT_CORNER] = load_cursor("bottom_right_corner");
+}
+
/*
* Sets the cursor of the root window to the 'pointer' cursor.
*
@@ -56,11 +55,13 @@ void xcursor_load_cursors(void) {
*
*/
void xcursor_set_root_cursor(int cursor_id) {
- xcb_change_window_attributes(conn, root, XCB_CW_CURSOR,
- (uint32_t[]){ xcursor_get_cursor(cursor_id) });
+ XSetWindowAttributes attributes;
+ attributes.cursor = xcursor_get_cursor(cursor_id);
+ XChangeWindowAttributes(xlibdpy, DefaultRootWindow(xlibdpy), CWCursor, &attributes);
+ XFlush(xlibdpy);
}
-xcb_cursor_t xcursor_get_cursor(enum xcursor_cursor_t c) {
+Cursor xcursor_get_cursor(enum xcursor_cursor_t c) {
assert(c >= 0 && c < XCURSOR_CURSOR_MAX);
return cursors[c];
}