summaryrefslogtreecommitdiffstats
path: root/client/x11/red_window.cpp
diff options
context:
space:
mode:
authorIzik Eidus <ieidus@redhat.com>2009-11-09 22:23:14 +0200
committerYaniv Kamay <ykamay@redhat.com>2009-11-09 22:34:05 +0200
commit54cf04beed5e7617459cb00fa07be52db6c6e0d7 (patch)
treea517ea07c42243beaf23d6ed2d2dfec4a3f2e968 /client/x11/red_window.cpp
parent1121d8c6293b5fc79e19bbfb477b611a5ba22359 (diff)
downloadspice-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/x11/red_window.cpp')
-rw-r--r--client/x11/red_window.cpp8
1 files changed, 3 insertions, 5 deletions
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");