client: fix colormap handling.

Signed-off-by: Izik Eidus <ieidus@redhat.com>
This commit is contained in:
Izik Eidus 2009-11-09 22:23:14 +02:00 committed by Yaniv Kamay
parent 1121d8c629
commit 54cf04beed
3 changed files with 5 additions and 8 deletions

View File

@ -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,

View File

@ -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");

View File

@ -61,6 +61,7 @@ protected:
Icon* _icon;
bool _ignore_foucs;
bool _shadow_foucs_state;
Colormap _colormap;
};
#endif