1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 12:28:22 +01:00

- enabled the use of SHAPE extension in the color panel. without it the

magnifying glass captured image was shifted and unusable
- removed some comments left in the code for later reviewal
This commit is contained in:
dan
2002-12-01 05:49:13 +00:00
parent c0442b1c59
commit dd1ccd2fd6
3 changed files with 33 additions and 31 deletions

View File

@@ -36,7 +36,8 @@
#include <errno.h> #include <errno.h>
/* BUG There's something fishy with shaped windows */ /* BUG There's something fishy with shaped windows */
#if 1 /* Whithout shape extension the magnified image is completely broken -Dan */
#if 0
#ifdef SHAPE #ifdef SHAPE
#define SHAPE_WAS_DEFINED #define SHAPE_WAS_DEFINED
#undef SHAPE #undef SHAPE
@@ -1708,7 +1709,7 @@ magnifyCreatePixmap(WMColorPanel *panel)
/* Copy the magnified pixmap, with the clip mask, to background pixmap */ /* Copy the magnified pixmap, with the clip mask, to background pixmap */
XCopyArea(scr->display, panel->magnifyGlass->magPix, pixmap, XCopyArea(scr->display, panel->magnifyGlass->magPix, pixmap,
scr->clipGC, 0, 0, Cursor_mask_width, Cursor_mask_height, 0, 0); scr->clipGC, 0, 0, Cursor_mask_width, Cursor_mask_height, 0, 0);
/* (2,2) puts center pixel on center of glass */ /* (2,2) puts center pixel on center of glass */
return pixmap; return pixmap;

View File

@@ -306,18 +306,20 @@ WMCreateAntialiasedFont(WMScreen *scrPtr, char *fontName)
font->screen = scrPtr; font->screen = scrPtr;
#if 0 /* Xft sux. Loading a font with an invalid XLFD will give strange results
/* // Xft sux. Loading a font that doesn't exist will load the default * sometimes without returning any warning or error.
* defined in XftConfig without any warning or error */ * However Xft's idea of what font is invalid is quite strange:
font->font.normal = XLoadQueryFont(display, fname); * 1. If the XLFD doesn't have all its fields present will fail and
if (!font->font.normal) { * return NULL.
wfree(font); * 2. If all fields are present, but hold invalid values then it will:
wfree(fname); * a. If family is invalid, will load a default font without warning.
return NULL; * b. If the font size is invalid (non-numerical) it will fail and
} * return NULL.
XFreeFont(display, font->font.normal); * c. If other fields are invalid, will load the font specified by
#endif * the valid family name, ignoring any invalid fields. It will
* use a default medium weight and a default roman slant if they
* are invalid.
*/
font->font.xft = XftFontOpenXlfd(display, scrPtr->screen, fname); font->font.xft = XftFontOpenXlfd(display, scrPtr->screen, fname);
if (!font->font.xft) { if (!font->font.xft) {
wfree(font); wfree(font);
@@ -353,7 +355,6 @@ WMCreateAntialiasedFontSet(WMScreen *scrPtr, char *fontName)
fontName = xlfdFromFontName(fontName, True); fontName = xlfdFromFontName(fontName, True);
// use the second in list if available, instead of first?
if ((ptr = strchr(fontName, ','))) { if ((ptr = strchr(fontName, ','))) {
fname = wmalloc(ptr - fontName + 1); fname = wmalloc(ptr - fontName + 1);
strncpy(fname, fontName, ptr - fontName); strncpy(fname, fontName, ptr - fontName);
@@ -379,18 +380,20 @@ WMCreateAntialiasedFontSet(WMScreen *scrPtr, char *fontName)
font->screen = scrPtr; font->screen = scrPtr;
#if 0 /* Xft sux. Loading a font with an invalid XLFD will give strange results
/* // Xft sux. Loading a font that doesn't exist will load the default * sometimes without returning any warning or error.
* defined in XftConfig without any warning or error */ * However Xft's idea of what font is invalid is quite strange:
font->font.normal = XLoadQueryFont(display, fname); * 1. If the XLFD doesn't have all its fields present will fail and
if (!font->font.normal) { * return NULL.
wfree(font); * 2. If all fields are present, but hold invalid values then it will:
wfree(fname); * a. If family is invalid, will load a default font without warning.
return NULL; * b. If the font size is invalid (non-numerical) it will fail and
} * return NULL.
XFreeFont(display, font->font.normal); * c. If other fields are invalid, will load the font specified by
#endif * the valid family name, ignoring any invalid fields. It will
* use a default medium weight and a default roman slant if they
* are invalid.
*/
font->font.xft = XftFontOpenXlfd(display, scrPtr->screen, fname); font->font.xft = XftFontOpenXlfd(display, scrPtr->screen, fname);
if (!font->font.xft) { if (!font->font.xft) {
wfree(font); wfree(font);
@@ -917,7 +920,7 @@ changeFontProp(char *buf, char *newprop, int position)
int count; int count;
if (buf[0]!='-') { if (buf[0]!='-') {
// remove warning later. or maybe not /* // remove warning later. or maybe not */
wwarning(_("Invalid font specification: '%s'\n"), buf); wwarning(_("Invalid font specification: '%s'\n"), buf);
return; return;
} }
@@ -1025,7 +1028,6 @@ WMCopyFontWithChanges(WMScreen *scrPtr, WMFont *font,
if (totalProps == 0) { if (totalProps == 0) {
/* No options with fallback alternatives at all */ /* No options with fallback alternatives at all */
WMFreeBag(props); WMFreeBag(props);
//printf("try: '%s'\n '%s'\n", font->name, fname);
return WMCreateFontWithFlags(scrPtr, fname, fFlags); return WMCreateFontWithFlags(scrPtr, fname, fFlags);
} }
@@ -1040,7 +1042,6 @@ WMCopyFontWithChanges(WMScreen *scrPtr, WMFont *font,
} }
} }
result = WMCreateFontWithFlags(scrPtr, fname, fFlags); result = WMCreateFontWithFlags(scrPtr, fname, fFlags);
//printf("try: '%s'\n '%s'\n", font->name, fname);
if (result) { if (result) {
WMFreeBag(props); WMFreeBag(props);
return result; return result;

View File

@@ -3121,7 +3121,7 @@ setIconTitleBack(WScreen *scr, WDefaultEntry *entry, XColor *color, void *foo)
if (scr->icon_title_texture) { if (scr->icon_title_texture) {
wTextureDestroy(scr, (WTexture*)scr->icon_title_texture); wTextureDestroy(scr, (WTexture*)scr->icon_title_texture);
} }
// ?? why is this necessary? color was already parsed and alloced // ?? why is this necessary? color was already parsed and alloc'ed
XQueryColor (dpy, scr->w_colormap, color); XQueryColor (dpy, scr->w_colormap, color);
scr->icon_title_texture = wTextureMakeSolid(scr, color); scr->icon_title_texture = wTextureMakeSolid(scr, color);