This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via 9270ef0f3556aa8a1bd8f4e7191d0813ec5708dc (commit) from a2a5ee04d3fbbdc6fdcc4c7a932a5b11f3edee49 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/9270ef0f3556aa8a1bd8f4e7191d0813ec570...
commit 9270ef0f3556aa8a1bd8f4e7191d0813ec5708dc Author: Cyril Hrubis metan@ucw.cz Date: Sun Jun 3 21:26:05 2012 +0200
backends: X11, Add CREATE_ROOT mode.
diff --git a/include/backends/GP_X11.h b/include/backends/GP_X11.h index e03baf4..6d10928 100644 --- a/include/backends/GP_X11.h +++ b/include/backends/GP_X11.h @@ -30,6 +30,10 @@ enum GP_BackendX11Flags { * When set, w and h is ignored and root window is used */ GP_X11_USE_ROOT_WIN = 0x01, + /* + * Create new borderless window above the root window. + */ + GP_X11_CREATE_ROOT_WIN = 0x02, };
diff --git a/libs/backends/GP_BackendInit.c b/libs/backends/GP_BackendInit.c index 316b137..31fd3bf 100644 --- a/libs/backends/GP_BackendInit.c +++ b/libs/backends/GP_BackendInit.c @@ -147,6 +147,11 @@ static int x11_params_to_flags(const char *param, GP_Size *w, GP_Size *h, return 0; } + if (!strcasecmp(param, "CREATE_ROOT")) { + *flags |= GP_X11_CREATE_ROOT_WIN; + return 0; + } + /* * Accepts only string with format "intxint" or "intXint" */ diff --git a/libs/backends/GP_X11.c b/libs/backends/GP_X11.c index ffc7dca..8b12562 100644 --- a/libs/backends/GP_X11.c +++ b/libs/backends/GP_X11.c @@ -29,6 +29,8 @@
#include <X11/Xlib.h> #include <X11/Xutil.h> +#include <X11/Xatom.h> +#include <X11/Xmd.h>
#include "input/GP_InputDriverX11.h" #include "GP_X11.h" @@ -264,7 +266,7 @@ void create_window(struct x11_priv *x11, int x, int y, unsigned long attr_mask = 0; /* Set event mask */ - attrs.event_mask = ExposureMask | StructureNotifyMask |KeyPressMask | + attrs.event_mask = ExposureMask | StructureNotifyMask | KeyPressMask | KeyReleaseMask | PointerMotionMask; attr_mask |= CWEventMask; @@ -281,18 +283,149 @@ void create_window(struct x11_priv *x11, int x, int y, *w, *h);
XChangeWindowAttributes(x11->dpy, x11->win, attr_mask, &attrs); - + return; } - GP_DEBUG(2, "Opening window '%s' %ix%i-%ux%u", - caption, x, y, *w, *h); - /* * For some reason reading mouse button clicks on root win are not * allowed... */ - attrs.event_mask |= ButtonPressMask | ButtonReleaseMask ; + attrs.event_mask |= ButtonPressMask | ButtonReleaseMask; + + /* + * Create undecoreated root window on background + */ + if (flags & GP_X11_CREATE_ROOT_WIN) { + Atom xa; + + *w = DisplayWidth(x11->dpy, x11->scr); + *h = DisplayHeight(x11->dpy, x11->scr); + + GP_DEBUG(2, "Creating a window above root, owerriding size to %ux%u", + *w, *h); + + x11->win = XCreateWindow(x11->dpy, DefaultRootWindow(x11->dpy), + 0, 0, *w, *h, 0, CopyFromParent, + InputOutput, CopyFromParent, attr_mask, &attrs); + + /* Set empty WM_PROTOCOLS */ + GP_DEBUG(2, "Setting empty MW_PROTOCOLS"); + XSetWMProtocols(x11->dpy, x11->win, NULL, 0); + + /* Set window type to desktop */ + xa = XInternAtom(x11->dpy, "_NET_WM_WINDOW_TYPE", False); + + if (xa != None) { + GP_DEBUG(2, "Setting Atom _NET_WM_WINDOW_TYPE to _NET_WM_WINDOW_TYPE_DESKTOP"); + + Atom xa_prop = XInternAtom(x11->dpy, "_NET_WM_WINDOW_TYPE_DESKTOP", False); + + XChangeProperty(x11->dpy, x11->win, xa, XA_ATOM, 32, + PropModeReplace, (unsigned char *) &xa_prop, 1); + } + + /* Turn off window decoration */ + xa = XInternAtom(x11->dpy, "_MOTIF_WM_HINTS", False); + + if (xa != None) { + GP_DEBUG(2, "Setting Atom _MOTIF_WM_HINTS to 2, 0, 0, 0, 0"); + + long prop[5] = {2, 0, 0, 0, 0}; + + XChangeProperty(x11->dpy, x11->win, xa, xa, 32, + PropModeReplace, (unsigned char *) prop, 5); + } + + /* Set below other windows */ + xa = XInternAtom(x11->dpy, "_WIN_LAYER", False); + + if (xa != None) { + GP_DEBUG(2, "Setting Atom _WIN_LAYER to 6"); + + long prop = 6; + + XChangeProperty(x11->dpy, x11->win, xa, XA_CARDINAL, 32, + PropModeAppend, (unsigned char *) &prop, 1); + } + + xa = XInternAtom(x11->dpy, "_NET_WM_STATE", False); + + if (xa != None) { + GP_DEBUG(2, "Setting Atom _NET_WM_STATE to _NET_WM_STATE_BELOW"); + + Atom xa_prop = XInternAtom(x11->dpy, "_NET_WM_STATE_BELOW", False); + + XChangeProperty(x11->dpy, x11->win, xa, XA_ATOM, 32, + PropModeAppend, (unsigned char *) &xa_prop, 1); + } + + /* Set sticky */ + xa = XInternAtom(x11->dpy, "_NET_WM_DESKTOP", False); + + if (xa != None) { + GP_DEBUG(2, "Setting Atom _NET_WM_DESKTOP to 0xffffffff"); + + CARD32 xa_prop = 0xffffffff; + + XChangeProperty(x11->dpy, x11->win, xa, XA_CARDINAL, 32, + PropModeAppend, (unsigned char *) &xa_prop, 1); + } + + xa = XInternAtom(x11->dpy, "_NET_WM_STATE", False); + + if (xa != None) { + GP_DEBUG(2, "Appending to Atom _NET_WM_STATE atom _NET_WM_STATE_STICKY"); + + Atom xa_prop = XInternAtom(x11->dpy, "_NET_WM_STATE_STICKY", False); + + XChangeProperty(x11->dpy, x11->win, xa, XA_ATOM, 32, + PropModeAppend, (unsigned char *) &xa_prop, 1); + } + + /* Skip taskbar */ + xa = XInternAtom(x11->dpy, "_NET_WM_STATE", False); + + if (xa != None) { + GP_DEBUG(2, "Appending to Atom _NET_WM_STATE atom _NET_STATE_SKIP_TASKBAR"); + + Atom xa_prop = XInternAtom(x11->dpy, "_NET_WM_STATE_SKIP_TASKBAR", False); + + XChangeProperty(x11->dpy, x11->win, xa, XA_ATOM, 32, + PropModeAppend, (unsigned char *) &xa_prop, 1); + } + + /* Skip pager */ + xa = XInternAtom(x11->dpy, "_NET_WM_STATE", False); + + if (xa != None) { + GP_DEBUG(2, "Appending to Atom _NET_WM_STATE atom _NET_STATE_SKIP_PAGER"); + + Atom xa_prop = XInternAtom(x11->dpy, "_NET_WM_STATE_SKIP_PAGER", False); + + XChangeProperty(x11->dpy, x11->win, xa, XA_ATOM, 32, + PropModeAppend, (unsigned char *) &xa_prop, 1); + } + + /* Set 100% opacity */ + xa = XInternAtom(x11->dpy, "_NET_WM_WINDOW_OPACITY", False); + + if (xa != None) { + GP_DEBUG(2, "Setting Atom _NET_WM_WINDOW_OPACITY to 0xffffffff"); + + long prop = 0xffffffff; + + XChangeProperty(x11->dpy, x11->win, xa, XA_CARDINAL, 32, + PropModeAppend, (unsigned char *) &prop, 1); + } + + /* Show window */ + XMapWindow(x11->dpy, x11->win); + return; + } + + GP_DEBUG(2, "Opening window '%s' %ix%i-%ux%u", + caption, x, y, *w, *h);
x11->win = XCreateWindow(x11->dpy, DefaultRootWindow(x11->dpy), x, y, *w, *h, 0, CopyFromParent,
-----------------------------------------------------------------------
Summary of changes: include/backends/GP_X11.h | 4 + libs/backends/GP_BackendInit.c | 5 ++ libs/backends/GP_X11.c | 145 ++++++++++++++++++++++++++++++++++++++-- 3 files changed, 148 insertions(+), 6 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.