Skip to content

Commit

Permalink
X11: XWMHints must be allocated by XAllocVMHints since it can be exte…
Browse files Browse the repository at this point in the history
…nded
  • Loading branch information
Joakim Plate committed Sep 21, 2012
1 parent 0a51b45 commit d33967f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions xbmc/windowing/X11/WinSystemX11.cpp
Expand Up @@ -304,21 +304,23 @@ bool CWinSystemX11::CreateNewWindow(const CStdString& name, bool fullScreen, RES


m_icon = AllocateIconPixmap(m_dpy, m_wmWindow); m_icon = AllocateIconPixmap(m_dpy, m_wmWindow);


XWMHints wm_hints; XWMHints* wm_hints = XAllocWMHints();
XTextProperty windowName, iconName; XTextProperty windowName, iconName;
const char* title = "XBMC Media Center"; const char* title = "XBMC Media Center";


XStringListToTextProperty((char**)&title, 1, &windowName); XStringListToTextProperty((char**)&title, 1, &windowName);
XStringListToTextProperty((char**)&title, 1, &iconName); XStringListToTextProperty((char**)&title, 1, &iconName);
wm_hints.initial_state = NormalState; wm_hints->initial_state = NormalState;
wm_hints.input = True; wm_hints->input = True;
wm_hints.icon_pixmap = m_icon; wm_hints->icon_pixmap = m_icon;
wm_hints.flags = StateHint | IconPixmapHint | InputHint; wm_hints->flags = StateHint | IconPixmapHint | InputHint;


XSetWMProperties(m_dpy, m_wmWindow, &windowName, &iconName, XSetWMProperties(m_dpy, m_wmWindow, &windowName, &iconName,
NULL, 0, NULL, &wm_hints, NULL, 0, NULL, wm_hints,
NULL); NULL);


XFree(wm_hints);

// register interest in the delete window message // register interest in the delete window message
Atom wmDeleteMessage = XInternAtom(m_dpy, "WM_DELETE_WINDOW", False); Atom wmDeleteMessage = XInternAtom(m_dpy, "WM_DELETE_WINDOW", False);
XSetWMProtocols(m_dpy, m_wmWindow, &wmDeleteMessage, 1); XSetWMProtocols(m_dpy, m_wmWindow, &wmDeleteMessage, 1);
Expand Down

0 comments on commit d33967f

Please sign in to comment.