Commit 14b8de37 authored by Ray Strode's avatar Ray Strode Committed by Ray Strode
Browse files

Bug 305564 again.

2005-05-30  Ray Strode  <rstrode@redhat.com>

	Bug 305564 again.

	When drawing XOR resize popup use "fixed" font instead of
	-misc-fixed-*-16-* xlfd.  Should work on more xservers.

	Also take steps to fail better if the xserver isn't
	cooperating.

	* src/effects.c (draw_xor_rect): if we can't draw font box
	for whatever reason, at least draw grid frames.

	* src/screen.c (meta_screen_new): use fixed alias instead
	of a xfld.  Don't pass GCFont to XCreateGC if font couldn't
	be loaded.  Print a warning if font couldn't be loaded.
parent 1799ef60
2005-05-30 Ray Strode <rstrode@redhat.com>
Bug 305564 again.
When drawing XOR resize popup use "fixed" font instead of
-misc-fixed-*-16-* xlfd. Should work on more xservers.
Also take steps to fail better if the xserver isn't
cooperating.
* src/effects.c (draw_xor_rect): if we can't draw font box
for whatever reason, at least draw grid frames.
* src/screen.c (meta_screen_new): use fixed alias instead
of a xfld. Don't pass GCFont to XCreateGC if font couldn't
be loaded. Print a warning if font couldn't be loaded.
2005-05-26 Elijah Newren <newren@gmail.com>
* HACKING: Add a clarification that METACITY_VERBOSE needs to be
......
......@@ -472,7 +472,6 @@ draw_xor_rect (MetaScreen *screen,
if ((width >= 0) && (height >= 0))
{
int box_width, box_height;
XGCValues gc_values = { 0 };
if (XGetGCValues (screen->display->xdisplay,
......@@ -485,6 +484,7 @@ draw_xor_rect (MetaScreen *screen,
XFontStruct *font_struct;
int text_width, text_height;
int box_x, box_y;
int box_width, box_height;
font_struct = XQueryFont (screen->display->xdisplay,
gc_values.font);
......@@ -501,6 +501,7 @@ draw_xor_rect (MetaScreen *screen,
box_width = text_width + 2 * LINE_WIDTH;
box_height = text_height + 2 * LINE_WIDTH;
box_x = rect->x + (rect->width - box_width) / 2;
box_y = rect->y + (rect->height - box_height) / 2;
......@@ -521,15 +522,14 @@ draw_xor_rect (MetaScreen *screen,
}
g_free (text);
}
}
if ((box_width + LINE_WIDTH) >= (rect->width / 3))
return;
if ((box_height + LINE_WIDTH) >= (rect->height / 3))
return;
if ((box_width + LINE_WIDTH) >= (rect->width / 3))
return;
if ((box_height + LINE_WIDTH) >= (rect->height / 3))
return;
}
}
}
/* Two vertical lines at 1/3 and 2/3 */
......
......@@ -546,17 +546,31 @@ meta_screen_new (MetaDisplay *display,
screen->trans_picture = None;
{
XFontStruct *font_info;
XGCValues gc_values;
gulong value_mask = 0;
gc_values.subwindow_mode = IncludeInferiors;
value_mask |= GCSubwindowMode;
gc_values.function = GXinvert;
value_mask |= GCFunction;
gc_values.line_width = META_WIREFRAME_XOR_LINE_WIDTH;
gc_values.font = XLoadFont (screen->display->xdisplay,
"-misc-fixed-*-*-*-*-16-*-*-*-*-*-*-*");
value_mask |= GCLineWidth;
font_info = XLoadQueryFont (screen->display->xdisplay, "fixed");
if (font_info != NULL)
{
gc_values.font = font_info->fid;
value_mask |= GCFont;
XFreeFontInfo (NULL, font_info, 0);
}
else
meta_warning ("xserver doesn't have 'fixed' font.\n");
screen->root_xor_gc = XCreateGC (screen->display->xdisplay,
screen->xroot,
GCSubwindowMode | GCFunction | GCLineWidth | GCFont,
value_mask,
&gc_values);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment