mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-30 09:46:50 +00:00
client: fix colormap handling.
Signed-off-by: Izik Eidus <ieidus@redhat.com>
This commit is contained in:
parent
1121d8c629
commit
54cf04beed
@ -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,
|
||||
|
||||
@ -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");
|
||||
|
||||
@ -61,6 +61,7 @@ protected:
|
||||
Icon* _icon;
|
||||
bool _ignore_foucs;
|
||||
bool _shadow_foucs_state;
|
||||
Colormap _colormap;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Loading…
Reference in New Issue
Block a user