all repos — tint2 @ b6efa12befa6e8f08e99ac1ec7808c547f0df7b1

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

Workaround for issue 353 (broken xrandr)

git-svn-id: http://tint2.googlecode.com/svn/trunk@663 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
o9000 o9000
commit

b6efa12befa6e8f08e99ac1ec7808c547f0df7b1

parent

c59f2399991499f9650c56676f06640993f826b2

1 files changed, 12 insertions(+), 0 deletions(-)

jump to
M src/server.csrc/server.c

@@ -271,6 +271,18 @@ XRRScreenResources *res = XRRGetScreenResourcesCurrent(server.dsp, server.root_win);

if (res && res->ncrtc >= nbmonitor) { // use xrandr to identify monitors (does not work with proprietery nvidia drivers) + + // Workaround for issue https://code.google.com/p/tint2/issues/detail?id=353 + // on some recent configs, XRRGetScreenResourcesCurrent returns a fantom monitor at last position + { + int i = res->ncrtc - 1; + XRRCrtcInfo* crtc_info = XRRGetCrtcInfo(server.dsp, res, res->crtcs[i]); + if (!(crtc_info->x || crtc_info->y || crtc_info->width || crtc_info->height)) { + res->ncrtc -= 1; + } + XRRFreeCrtcInfo(crtc_info); + } + printf("xRandr: Found crtc's: %d\n", res->ncrtc ); server.monitor = malloc(res->ncrtc * sizeof(Monitor)); for (i=0; i<res->ncrtc; ++i) {