mirror of
https://github.com/gnustep/libs-back.git
synced 2025-04-22 23:42:16 +00:00
* Source/x11/XGServerWindow.m (-_createAppIconPixmaps): Made
preconditions of new code explicit. * Source/x11/XGServerWindow.m (-orderwindow:::): Set icon pixmap only for WindowMaker.
This commit is contained in:
parent
638940fb28
commit
4924e11a0b
2 changed files with 41 additions and 17 deletions
|
@ -1,9 +1,16 @@
|
|||
2020-02-21 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/x11/XGServerWindow.m (-_createAppIconPixmaps): Made
|
||||
preconditions of new code explicit.
|
||||
* Source/x11/XGServerWindow.m (-orderwindow:::): Set icon pixmap
|
||||
only for WindowMaker.
|
||||
|
||||
2020-02-20 Sergii Stoian <stoyan255@gmail.com>
|
||||
|
||||
* Headers/x11/XGServer.h (GSDisplayServer): added new ivar xScreenSize
|
||||
to hold Xlib screen size dimensions.
|
||||
|
||||
* Source/x11/XGServerWindow.m:
|
||||
* Source/x11/XGServerWindow.m:
|
||||
(_OSFrameToXFrame:for:): use xScreenSize instead of DisplayHeight.
|
||||
(_OSFrameToXHints:for:): ditto.
|
||||
(_XFrameToOSFrame:for:): ditto.
|
||||
|
|
|
@ -2832,14 +2832,29 @@ swapColors(unsigned char *image_data, NSBitmapImageRep *rep)
|
|||
|
||||
rep = getStandardBitmap([NSApp applicationIconImage]);
|
||||
if (rep == nil)
|
||||
return 0;
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
rcontext = [self screenRContext];
|
||||
width = [rep pixelsWide];
|
||||
height = [rep pixelsHigh];
|
||||
colors = [rep samplesPerPixel];
|
||||
|
||||
if (rcontext->depth != 32)
|
||||
{
|
||||
NSLog(@"Unsupported context depth %d", rcontext->depth);
|
||||
return 0;
|
||||
}
|
||||
|
||||
rxImage = RCreateXImage(rcontext, rcontext->depth, width, height);
|
||||
if (rxImage->image->bytes_per_line != 4 * width)
|
||||
{
|
||||
NSLog(@"bytes_per_line %d does not match width %d", rxImage->image->bytes_per_line, width);
|
||||
RDestroyXImage(rcontext, rxImage);
|
||||
return 0;
|
||||
}
|
||||
|
||||
swapColors((unsigned char *)rxImage->image->data, rep);
|
||||
|
||||
xIconPixmap = XCreatePixmap(dpy, rcontext->drawable,
|
||||
|
@ -2891,21 +2906,23 @@ swapColors(unsigned char *image_data, NSBitmapImageRep *rep)
|
|||
gen_hints.window_group = ROOT;
|
||||
gen_hints.icon_window = window->ident;
|
||||
|
||||
if (!didCreatePixmaps)
|
||||
{
|
||||
[self _createAppIconPixmaps];
|
||||
}
|
||||
|
||||
if (xIconPixmap)
|
||||
{
|
||||
gen_hints.flags |= IconPixmapHint;
|
||||
gen_hints.icon_pixmap = xIconPixmap;
|
||||
}
|
||||
if (xIconMask)
|
||||
{
|
||||
gen_hints.flags |= IconMaskHint;
|
||||
gen_hints.icon_mask = xIconMask;
|
||||
}
|
||||
if ((generic.wm & XGWM_WINDOWMAKER) != 0)
|
||||
{
|
||||
if (!didCreatePixmaps)
|
||||
{
|
||||
[self _createAppIconPixmaps];
|
||||
}
|
||||
if (xIconPixmap)
|
||||
{
|
||||
gen_hints.flags |= IconPixmapHint;
|
||||
gen_hints.icon_pixmap = xIconPixmap;
|
||||
}
|
||||
if (xIconMask)
|
||||
{
|
||||
gen_hints.flags |= IconMaskHint;
|
||||
gen_hints.icon_mask = xIconMask;
|
||||
}
|
||||
}
|
||||
|
||||
XSetWMHints(dpy, ROOT, &gen_hints);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue