Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 103270 Details for
Bug 156981
x11-terms/root-tail-1.2-r2 doesn't work with window managers that manage the root window
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
root-tail patch
patch (text/plain), 3.49 KB, created by
Yarda
on 2006-12-03 06:18:29 UTC
(
hide
)
Description:
root-tail patch
Filename:
MIME Type:
Creator:
Yarda
Created:
2006-12-03 06:18:29 UTC
Size:
3.49 KB
patch
obsolete
>--- root-tail.c.old 2004-07-30 21:33:20.000000000 +0200 >+++ root-tail.c 2006-12-03 14:24:46.000000000 +0100 >@@ -52,6 +52,8 @@ > /* some italic fonts still go over the margin - this margin of error cleans up the mess */ > #define MARGIN_OF_ERROR 2 > >+#define ATOM(a) XInternAtom(disp, #a, False) >+ > /* data structures */ > struct logfile_entry > { >@@ -136,6 +138,8 @@ Display *disp; > Window root; > GC WinGC; > >+int workarea[4]; >+ > #if HAS_REGEX > struct re_list > { >@@ -282,12 +286,85 @@ find_root_window (Display *display, int > } > #endif /* USE_TOON_GET_ROOT_WINDOW */ > >+ >+static void update_workarea() >+{ >+ int screen = DefaultScreen(disp); >+ Window root = RootWindow(disp, screen); >+ unsigned long nitems, bytes; >+ unsigned char *buf = NULL; >+ Atom type; >+ int format; >+ /* default work area is display */ >+ >+ workarea[0] = 0; >+ workarea[1] = 0; >+ workarea[2] = DisplayWidth(disp, screen); >+ workarea[3] = DisplayHeight(disp, screen); >+ >+ /* get current desktop */ >+ if (XGetWindowProperty(disp, root, ATOM(_NET_CURRENT_DESKTOP), >+ 0, 1, False, XA_CARDINAL, &type, &format, >+ &nitems, &bytes, &buf) == Success >+ && type == XA_CARDINAL && nitems > 0) { >+ >+ //Currently unused >+ /* long desktop = * (long *) buf; */ >+ >+ XFree(buf); >+ buf = 0; >+ >+ } >+ >+ if (buf) { >+ XFree(buf); >+ buf = 0; >+ } >+} >+ >+static Window find_subwindow(Window win, int w, int h) >+{ >+ unsigned int i, j; >+ Window troot, parent, *children; >+ unsigned int n; >+ >+ /* search subwindows with same size as display or work area */ >+ >+ for (i = 0; i < 10; i++) { >+ XQueryTree(disp, win, &troot, &parent, &children, &n); >+ >+ for (j = 0; j < n; j++) { >+ XWindowAttributes attrs; >+ >+ if (XGetWindowAttributes >+ (disp, children[j], &attrs)) { >+ /* Window must be mapped and same size as display or work space */ >+ if (attrs.map_state != 0 && >+ ((attrs.width == DisplayWidth(disp, DefaultScreen(disp)) >+ && attrs.height == DisplayHeight(disp, DefaultScreen(disp))) >+ || (attrs.width == w >+ && attrs.height == h))) { >+ win = children[j]; >+ break; >+ } >+ } >+ } >+ >+ XFree(children); >+ if (j == n) >+ break; >+ } >+ >+ return win; >+} >+ > void > InitWindow (void) > { > XGCValues gcv; > unsigned long gcm; > int screen, ScreenWidth, ScreenHeight; >+ Window win; > struct logfile_entry *e; > > if (!(disp = XOpenDisplay (dispname))) >@@ -302,6 +379,14 @@ InitWindow (void) > > find_root_window (disp, screen); > >+ /* get subwindows from root */ >+ win = find_subwindow(root, -1, -1); >+ >+ update_workarea(); >+ >+ win = find_subwindow(win, workarea[2], workarea[3]); >+ >+ root=win; > gcm = GCBackground; > gcv.graphics_exposures = True; > WinGC = XCreateGC (disp, root, gcm, &gcv);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 156981
: 103270