diff options
author | Izik Eidus <ieidus@redhat.com> | 2009-11-09 22:23:14 +0200 |
---|---|---|
committer | Yaniv Kamay <ykamay@redhat.com> | 2010-01-03 17:21:27 +0200 |
commit | 95a9bcb9175f2515a43212b2e5d5fe4b1534199a (patch) | |
tree | 1917b3df38e1e7003457602c3cb3f81280b8ce46 /client | |
parent | eb85aae81ffe544273b724cc1288ecd143ef07a6 (diff) | |
download | spice-95a9bcb9175f2515a43212b2e5d5fe4b1534199a.tar.gz spice-95a9bcb9175f2515a43212b2e5d5fe4b1534199a.tar.xz spice-95a9bcb9175f2515a43212b2e5d5fe4b1534199a.zip |
client: fix colormap handling.
Signed-off-by: Izik Eidus <ieidus@redhat.com>
Diffstat (limited to 'client')
-rw-r--r-- | client/x11/platform.cpp | 4 | ||||
-rw-r--r-- | client/x11/red_window.cpp | 8 | ||||
-rw-r--r-- | client/x11/red_window_p.h | 1 |
3 files changed, 5 insertions, 8 deletions
diff --git a/client/x11/platform.cpp b/client/x11/platform.cpp index f4963b5e..8288f555 100644 --- a/client/x11/platform.cpp +++ b/client/x11/platform.cpp @@ -2073,9 +2073,7 @@ void Platform::init() fb_config = new GLXFBConfig *[ScreenCount(x_display)]; memset(fb_config, 0, sizeof(GLXFBConfig *) * ScreenCount(x_display)); - // working with KDE and visual from glXGetVisualFromFBConfig is not working - // well. for now disabling OGL. - if (0 && threads_enable && glXQueryExtension(x_display, &err, &ev)) { + if (threads_enable && glXQueryExtension(x_display, &err, &ev)) { int num_configs; int attrlist[] = { GLX_RENDER_TYPE, GLX_RGBA_BIT, diff --git a/client/x11/red_window.cpp b/client/x11/red_window.cpp index 9cce15f6..5601232a 100644 --- a/client/x11/red_window.cpp +++ b/client/x11/red_window.cpp @@ -954,6 +954,7 @@ void RedWindow_p::destroy(PixelsSource_p& pix_source) _glcont_copy = NULL; } XDestroyWindow(x_display, window); + XFreeColormap(x_display, _colormap); XFreeGC(x_display, pix_source.x_drawable.gc); pix_source.x_drawable.gc = NULL; pix_source.x_drawable.drawable = None; @@ -979,17 +980,14 @@ void RedWindow_p::create(RedWindow& red_window, PixelsSource_p& pix_source, int ButtonReleaseMask | PointerMotionMask | FocusChangeMask | EnterWindowMask | LeaveWindowMask; - Colormap colormap; - - colormap = XCreateColormap(x_display, root_window, XPlatform::get_vinfo()[in_screen]->visual, + _colormap = XCreateColormap(x_display, root_window, XPlatform::get_vinfo()[in_screen]->visual, AllocNone); - win_attributes.colormap = colormap; + win_attributes.colormap = _colormap; mask |= CWColormap; window = XCreateWindow(x_display, root_window, x, y, width, height, 0, XPlatform::get_vinfo()[in_screen]->depth, InputOutput, XPlatform::get_vinfo()[in_screen]->visual, mask, &win_attributes); - XFreeColormap(x_display, colormap); if (!window) { THROW("create X window failed"); diff --git a/client/x11/red_window_p.h b/client/x11/red_window_p.h index 02cbdf98..a9ae795b 100644 --- a/client/x11/red_window_p.h +++ b/client/x11/red_window_p.h @@ -61,6 +61,7 @@ protected: Icon* _icon; bool _ignore_foucs; bool _shadow_foucs_state; + Colormap _colormap; }; #endif |