mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +01:00
Make get_wwindow_image_from_x11() take Window as argument
The function get_wwindow_image_from_x11() is renamed to get_window_image_from_x11() and does the same work, but now its argument is a Window struct instead of a WWindow. This change is better because it allows objects with Windows (but without WWindows) to call this function. The function now is not static to allow its use in other parts of the code.
This commit is contained in:
committed by
Carlos R. Mafra
parent
3e83e9d5ae
commit
19326554cc
@@ -420,7 +420,7 @@ static RImage *makeRImageFromARGBData(unsigned long *data)
|
|||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
static RImage *get_wwindow_image_from_x11(WWindow *wwin)
|
RImage *get_window_image_from_x11(Window window)
|
||||||
{
|
{
|
||||||
RImage *image;
|
RImage *image;
|
||||||
Atom type;
|
Atom type;
|
||||||
@@ -429,7 +429,7 @@ static RImage *get_wwindow_image_from_x11(WWindow *wwin)
|
|||||||
unsigned long *property, *data;
|
unsigned long *property, *data;
|
||||||
|
|
||||||
/* Get the icon from X11 Window */
|
/* Get the icon from X11 Window */
|
||||||
if (XGetWindowProperty(dpy, wwin->client_win, net_wm_icon, 0L, LONG_MAX,
|
if (XGetWindowProperty(dpy, window, net_wm_icon, 0L, LONG_MAX,
|
||||||
False, XA_CARDINAL, &type, &format, &items, &rest,
|
False, XA_CARDINAL, &type, &format, &items, &rest,
|
||||||
(unsigned char **)&property) != Success || !property)
|
(unsigned char **)&property) != Success || !property)
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -464,7 +464,7 @@ static void updateIconImage(WWindow *wwin)
|
|||||||
RReleaseImage(wwin->net_icon_image);
|
RReleaseImage(wwin->net_icon_image);
|
||||||
|
|
||||||
/* Save the icon in the X11 icon */
|
/* Save the icon in the X11 icon */
|
||||||
wwin->net_icon_image = get_wwindow_image_from_x11(wwin);
|
wwin->net_icon_image = get_window_image_from_x11(wwin->client_win);
|
||||||
|
|
||||||
/* Refresh the Window Icon */
|
/* Refresh the Window Icon */
|
||||||
if (wwin->icon)
|
if (wwin->icon)
|
||||||
|
|||||||
@@ -45,4 +45,5 @@ char *wNETWMGetIconName(Window window);
|
|||||||
char *wNETWMGetWindowName(Window window);
|
char *wNETWMGetWindowName(Window window);
|
||||||
void wNETFrameExtents(WWindow *wwin);
|
void wNETFrameExtents(WWindow *wwin);
|
||||||
void wNETCleanupFrameExtents(WWindow *wwin);
|
void wNETCleanupFrameExtents(WWindow *wwin);
|
||||||
|
RImage *get_window_image_from_x11(Window window);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user