hw/xwin: xcbify internal window manager
Convert the code for the multiwindow mode internal window manager to xcb xcb conversion avoids xlib/xserver namespace collision and _XSERVER64 type sizing issues v2: Various fixes v3: Don't include X11/extensions/windowswmstr.h, which uses the Display type and thus depends on Xlib.h, just for _WINDOWSWM_NATIVE_HWND v4: Fix indentation, add some error handling. Fix a bug with ConfigureNotify handling v5: Fix a bug which prevented WM_NORMAL_HINTS from being checked Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
This commit is contained in:
parent
8114b8127f
commit
a6288f0954
|
@ -2150,7 +2150,7 @@ if test "x$XWIN" = xyes; then
|
||||||
AC_DEFINE_UNQUOTED(__VENDORDWEBSUPPORT__, ["$VENDOR_WEB"], [Vendor web address for support])
|
AC_DEFINE_UNQUOTED(__VENDORDWEBSUPPORT__, ["$VENDOR_WEB"], [Vendor web address for support])
|
||||||
AC_CHECK_TOOL(WINDRES, windres)
|
AC_CHECK_TOOL(WINDRES, windres)
|
||||||
|
|
||||||
PKG_CHECK_MODULES([XWINMODULES],[x11 xdmcp xau xfixes x11-xcb xcb-image xcb-icccm])
|
PKG_CHECK_MODULES([XWINMODULES],[x11 xdmcp xau xfixes x11-xcb xcb-aux xcb-image xcb-ewmh xcb-icccm])
|
||||||
|
|
||||||
if test "x$WINDOWSWM" = xauto; then
|
if test "x$WINDOWSWM" = xauto; then
|
||||||
PKG_CHECK_EXISTS($WINDOWSWMPROTO, [WINDOWSWM=yes], [WINDOWSWM=no])
|
PKG_CHECK_EXISTS($WINDOWSWMPROTO, [WINDOWSWM=yes], [WINDOWSWM=no])
|
||||||
|
|
|
@ -38,6 +38,16 @@
|
||||||
#include "securitysrv.h"
|
#include "securitysrv.h"
|
||||||
#include "os/osdep.h"
|
#include "os/osdep.h"
|
||||||
|
|
||||||
|
#include <xcb/xcb.h>
|
||||||
|
|
||||||
|
/* Need to get this from Xlib.h */
|
||||||
|
extern void XSetAuthorization(
|
||||||
|
const char * /* name */,
|
||||||
|
int /* namelen */,
|
||||||
|
const char * /* data */,
|
||||||
|
int /* datalen */
|
||||||
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Constants
|
* Constants
|
||||||
*/
|
*/
|
||||||
|
@ -51,6 +61,7 @@
|
||||||
static XID g_authId = 0;
|
static XID g_authId = 0;
|
||||||
static unsigned int g_uiAuthDataLen = 0;
|
static unsigned int g_uiAuthDataLen = 0;
|
||||||
static char *g_pAuthData = NULL;
|
static char *g_pAuthData = NULL;
|
||||||
|
static xcb_auth_info_t auth_info;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Code to generate a MIT-MAGIC-COOKIE-1, copied from under XCSECURITY
|
* Code to generate a MIT-MAGIC-COOKIE-1, copied from under XCSECURITY
|
||||||
|
@ -131,6 +142,11 @@ winGenerateAuthorization(void)
|
||||||
g_uiAuthDataLen, g_pAuthData);
|
g_uiAuthDataLen, g_pAuthData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auth_info.name = AUTH_NAME;
|
||||||
|
auth_info.namelen = strlen(AUTH_NAME);
|
||||||
|
auth_info.data = g_pAuthData;
|
||||||
|
auth_info.datalen = g_uiAuthDataLen;
|
||||||
|
|
||||||
#ifdef XCSECURITY
|
#ifdef XCSECURITY
|
||||||
/* Allocate structure for additional auth information */
|
/* Allocate structure for additional auth information */
|
||||||
pAuth = (SecurityAuthorizationPtr)
|
pAuth = (SecurityAuthorizationPtr)
|
||||||
|
@ -168,3 +184,12 @@ winSetAuthorization(void)
|
||||||
XSetAuthorization(AUTH_NAME,
|
XSetAuthorization(AUTH_NAME,
|
||||||
strlen(AUTH_NAME), g_pAuthData, g_uiAuthDataLen);
|
strlen(AUTH_NAME), g_pAuthData, g_uiAuthDataLen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xcb_auth_info_t *
|
||||||
|
winGetXcbAuthInfo(void)
|
||||||
|
{
|
||||||
|
if (g_pAuthData)
|
||||||
|
return &auth_info;
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,3 @@
|
||||||
#if !defined(_WINWINDOW_H_)
|
|
||||||
#define _WINWINDOW_H_
|
|
||||||
/*
|
/*
|
||||||
*Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
|
*Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
|
||||||
*Copyright (C) Colin Harrison 2005-2009
|
*Copyright (C) Colin Harrison 2005-2009
|
||||||
|
@ -31,6 +29,8 @@
|
||||||
* Authors: Kensuke Matsuzaki
|
* Authors: Kensuke Matsuzaki
|
||||||
* Colin Harrison
|
* Colin Harrison
|
||||||
*/
|
*/
|
||||||
|
#if !defined(_WINWINDOW_H_)
|
||||||
|
#define _WINWINDOW_H_
|
||||||
|
|
||||||
#ifndef NO
|
#ifndef NO
|
||||||
#define NO 0
|
#define NO 0
|
||||||
|
@ -122,10 +122,16 @@ typedef struct _winWMMessageRec {
|
||||||
#define MwmDecorMinimize (1L << 5)
|
#define MwmDecorMinimize (1L << 5)
|
||||||
#define MwmDecorMaximize (1L << 6)
|
#define MwmDecorMaximize (1L << 6)
|
||||||
|
|
||||||
/* This structure only contains 3 elements... the Motif 2.0 structure
|
/*
|
||||||
contains 5... we only need the first 3... so that is all we will define */
|
This structure only contains 3 elements. The Motif 2.0 structure contains 5,
|
||||||
|
but we only need the first 3, so that is all we will define
|
||||||
|
|
||||||
|
This structure represents xcb_get_property()'s view of the property as a
|
||||||
|
sequence of ints, rather than XGetWindowProperty()'s view of the property as a
|
||||||
|
sequence of arch-dependent longs.
|
||||||
|
*/
|
||||||
typedef struct MwmHints {
|
typedef struct MwmHints {
|
||||||
unsigned long flags, functions, decorations;
|
unsigned int flags, functions, decorations;
|
||||||
} MwmHints;
|
} MwmHints;
|
||||||
|
|
||||||
#define PropMwmHintsElements 3
|
#define PropMwmHintsElements 3
|
||||||
|
|
Loading…
Reference in New Issue