(!1654) Xnest: add helper for retrieving GC XID on upstream connection
Upcoming patches will need to retieve GC's XIDs on the upstream connection. Moving this out into separate .c file, in order to not creating more dependencies on Xlib headers, which we wanna get rid of. For now, looking at the Xlib GC structure, attached to our DDX GCs. When all users of the Xlib GC have gone (ie. moved all consumers to xcb), we'll create the GC via xcb directly, thus replacing the Xlib GC struct by XID - the interface of this helper will remain the same. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
b910f4b83f
commit
0b0ffeaeb2
|
@ -69,6 +69,7 @@ typedef XID KeySym64;
|
|||
|
||||
#define GC XlibGC
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xlibint.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/extensions/shape.h>
|
||||
#include <X11/Xlib-xcb.h>
|
||||
|
|
|
@ -10,8 +10,11 @@
|
|||
#include <X11/Xdefs.h>
|
||||
#include <X11/Xproto.h>
|
||||
|
||||
#include "include/gc.h"
|
||||
|
||||
#include "Xnest.h"
|
||||
#include "xnest-xcb.h"
|
||||
#include "XNGC.h"
|
||||
|
||||
#include "Display.h"
|
||||
|
||||
|
@ -29,3 +32,15 @@ void xnest_upstream_setup(void) {
|
|||
xcb_screen_next (&iter);
|
||||
xnestUpstreamInfo.screenInfo = iter.data;
|
||||
}
|
||||
|
||||
/* retrieve upstream GC XID for our xserver GC */
|
||||
uint32_t xnest_upstream_gc(GCPtr pGC) {
|
||||
if (pGC == NULL) return 0;
|
||||
|
||||
xnestPrivGC *priv = dixLookupPrivate(&(pGC)->devPrivates, xnestGCPrivateKey);
|
||||
if ((priv == NULL) || (priv->gc == NULL)) return 0;
|
||||
|
||||
// make sure Xlib's GC cache is written out before using (server side) GC.
|
||||
XFlushGC(xnestDisplay, priv->gc);
|
||||
return priv->gc->gid;
|
||||
}
|
||||
|
|
|
@ -19,4 +19,7 @@ extern struct xnest_upstream_info xnestUpstreamInfo;
|
|||
/* fetch upstream connection's xcb setup data */
|
||||
void xnest_upstream_setup(void);
|
||||
|
||||
/* retrieve upstream GC XID for our xserver GC */
|
||||
uint32_t xnest_upstream_gc(GCPtr pGC);
|
||||
|
||||
#endif /* __XNEST__XCB_H */
|
||||
|
|
Loading…
Reference in New Issue