From d33967f07f3fa3d002abcdad3bf5814926e84e18 Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Thu, 19 Jul 2012 23:53:27 +0200 Subject: [PATCH] X11: XWMHints must be allocated by XAllocVMHints since it can be extended --- xbmc/windowing/X11/WinSystemX11.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp index ac7ab80d268a2..e640a04ced88e 100644 --- a/xbmc/windowing/X11/WinSystemX11.cpp +++ b/xbmc/windowing/X11/WinSystemX11.cpp @@ -304,21 +304,23 @@ bool CWinSystemX11::CreateNewWindow(const CStdString& name, bool fullScreen, RES m_icon = AllocateIconPixmap(m_dpy, m_wmWindow); - XWMHints wm_hints; + XWMHints* wm_hints = XAllocWMHints(); XTextProperty windowName, iconName; const char* title = "XBMC Media Center"; XStringListToTextProperty((char**)&title, 1, &windowName); XStringListToTextProperty((char**)&title, 1, &iconName); - wm_hints.initial_state = NormalState; - wm_hints.input = True; - wm_hints.icon_pixmap = m_icon; - wm_hints.flags = StateHint | IconPixmapHint | InputHint; + wm_hints->initial_state = NormalState; + wm_hints->input = True; + wm_hints->icon_pixmap = m_icon; + wm_hints->flags = StateHint | IconPixmapHint | InputHint; XSetWMProperties(m_dpy, m_wmWindow, &windowName, &iconName, - NULL, 0, NULL, &wm_hints, + NULL, 0, NULL, wm_hints, NULL); + XFree(wm_hints); + // register interest in the delete window message Atom wmDeleteMessage = XInternAtom(m_dpy, "WM_DELETE_WINDOW", False); XSetWMProtocols(m_dpy, m_wmWindow, &wmDeleteMessage, 1);