Skip to content
Browse files

X11: XWMHints must be allocated by XAllocVMHints since it can be exte…

…nded
  • Loading branch information...
1 parent 0a51b45 commit d33967f07f3fa3d002abcdad3bf5814926e84e18 @elupus committed Jul 19, 2012
Showing with 8 additions and 6 deletions.
  1. +8 −6 xbmc/windowing/X11/WinSystemX11.cpp
View
14 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);

0 comments on commit d33967f

Please sign in to comment.
Something went wrong with that request. Please try again.