diff options
author | Izik Eidus <ieidus@redhat.com> | 2009-11-09 22:23:14 +0200 |
---|---|---|
committer | Yaniv Kamay <ykamay@redhat.com> | 2009-11-09 22:34:05 +0200 |
commit | 54cf04beed5e7617459cb00fa07be52db6c6e0d7 (patch) | |
tree | a517ea07c42243beaf23d6ed2d2dfec4a3f2e968 /client | |
parent | 1121d8c6293b5fc79e19bbfb477b611a5ba22359 (diff) | |
download | spice-54cf04beed5e7617459cb00fa07be52db6c6e0d7.tar.gz spice-54cf04beed5e7617459cb00fa07be52db6c6e0d7.tar.xz spice-54cf04beed5e7617459cb00fa07be52db6c6e0d7.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 |