mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-25 07:32:36 +01:00
wmaker: add miniwindow apercu
This patch is adding miniwindow apercu when the mouse is over the miniwindows. To enable it you have to run WPref, in Miscellaneous Ergonomic Preferences, check miniwindow apercus. Then, you will be able to see a screenshot of the app when the mouse is over the miniwindow.
This commit is contained in:
committed by
Carlos R. Mafra
parent
b6d48420bb
commit
c6c7652e24
20
src/icon.c
20
src/icon.c
@@ -225,6 +225,9 @@ void wIconDestroy(WIcon *icon)
|
||||
if (icon->pixmap)
|
||||
XFreePixmap(dpy, icon->pixmap);
|
||||
|
||||
if (icon->apercu)
|
||||
XFreePixmap(dpy, icon->apercu);
|
||||
|
||||
unset_icon_image(icon);
|
||||
|
||||
wCoreDestroy(icon->core);
|
||||
@@ -584,6 +587,23 @@ void set_icon_image_from_image(WIcon *icon, RImage *image)
|
||||
icon->file_image = image;
|
||||
}
|
||||
|
||||
void set_icon_apercu(WIcon *icon, RImage *image)
|
||||
{
|
||||
Pixmap tmp;
|
||||
RImage *scaled_apercu;
|
||||
WScreen *scr = icon->core->screen_ptr;
|
||||
|
||||
scaled_apercu = RSmoothScaleImage(image, (wPreferences.icon_size - 1 - APERCU_BORDER) * 2,
|
||||
(wPreferences.icon_size - 1 - APERCU_BORDER) * 2 );
|
||||
|
||||
if (RConvertImage(scr->rcontext, scaled_apercu, &tmp)) {
|
||||
if (icon->apercu != None)
|
||||
XFreePixmap(dpy, icon->apercu);
|
||||
icon->apercu = tmp;
|
||||
}
|
||||
RReleaseImage(scaled_apercu);
|
||||
}
|
||||
|
||||
void wIconUpdate(WIcon *icon)
|
||||
{
|
||||
WWindow *wwin = NULL;
|
||||
|
||||
Reference in New Issue
Block a user