summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2002-08-24 20:54:23 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-08-24 20:54:23 +0000
commitb9002db37faf078b2b4ea6c81cedd6fa3b3f5c34 (patch)
treea40f6f040e7ed4b98b4b0ebfa3576222e4088244 /src
parent7e29e47e4b716ab94aca01a879bf78f374a4b457 (diff)
downloadmetacity-b9002db37faf078b2b4ea6c81cedd6fa3b3f5c34.tar.gz
metacity-b9002db37faf078b2b4ea6c81cedd6fa3b3f5c34.tar.bz2
translate some strings that should have been, and convert to locale
2002-08-24 Havoc Pennington <hp@redhat.com> * src/util.c: translate some strings that should have been, and convert to locale encoding before printing stuff. * src/stack.c (group_member_is_fullscreen): if window itself is fullscreen, return TRUE immediately. * src/window.c (meta_window_configure_request): add hack to fullscreenize large undecorated windows.
Diffstat (limited to 'src')
-rw-r--r--src/stack.c3
-rw-r--r--src/util.c38
-rw-r--r--src/window.c90
3 files changed, 106 insertions, 25 deletions
diff --git a/src/stack.c b/src/stack.c
index 94f1f3a..709dcfa 100644
--- a/src/stack.c
+++ b/src/stack.c
@@ -264,6 +264,9 @@ group_member_is_fullscreen (MetaWindow *window)
MetaGroup *group;
GSList *tmp;
gboolean retval;
+
+ if (window->fullscreen)
+ return TRUE;
group = meta_window_get_group (window);
if (group == NULL)
diff --git a/src/util.c b/src/util.c
index b604a61..03ebf2d 100644
--- a/src/util.c
+++ b/src/util.c
@@ -153,6 +153,22 @@ meta_set_replace_current_wm (gboolean setting)
replace_current = setting;
}
+static int
+utf8_fputs (const char *str,
+ FILE *f)
+{
+ char *l;
+
+ l = g_locale_from_utf8 (str, -1, NULL, NULL, NULL);
+
+ if (l == NULL)
+ fputs (str, f); /* just print it anyway, better than nothing */
+ else
+ fputs (l, f);
+
+ g_free (l);
+}
+
void
meta_debug_spew (const char *format, ...)
{
@@ -172,8 +188,8 @@ meta_debug_spew (const char *format, ...)
out = logfile ? logfile : stderr;
if (no_prefix == 0)
- fputs ("Window manager: ", out);
- fputs (str, out);
+ utf8_fputs (_("Window manager: "), out);
+ utf8_fputs (str, out);
fflush (out);
@@ -199,8 +215,8 @@ meta_verbose (const char *format, ...)
out = logfile ? logfile : stderr;
if (no_prefix == 0)
- fputs ("Window manager: ", out);
- fputs (str, out);
+ utf8_fputs ("Window manager: ", out);
+ utf8_fputs (str, out);
fflush (out);
@@ -265,7 +281,7 @@ meta_topic (MetaDebugTopic topic,
if (no_prefix == 0)
fprintf (out, "%s: ", topic_name (topic));
- fputs (str, out);
+ utf8_fputs (str, out);
fflush (out);
@@ -288,8 +304,8 @@ meta_bug (const char *format, ...)
out = logfile ? logfile : stderr;
if (no_prefix == 0)
- fputs ("Bug in window manager: ", out);
- fputs (str, out);
+ utf8_fputs (_("Bug in window manager: "), out);
+ utf8_fputs (str, out);
fflush (out);
@@ -317,8 +333,8 @@ meta_warning (const char *format, ...)
out = logfile ? logfile : stderr;
if (no_prefix == 0)
- fputs ("Window manager warning: ", out);
- fputs (str, out);
+ utf8_fputs (_("Window manager warning: "), out);
+ utf8_fputs (str, out);
g_free (str);
}
@@ -339,8 +355,8 @@ meta_fatal (const char *format, ...)
out = logfile ? logfile : stderr;
if (no_prefix == 0)
- fputs ("Window manager error: ", out);
- fputs (str, out);
+ utf8_fputs (_("Window manager error: "), out);
+ utf8_fputs (str, out);
fflush (out);
diff --git a/src/window.c b/src/window.c
index 49faa24..2f0936f 100644
--- a/src/window.c
+++ b/src/window.c
@@ -3196,6 +3196,42 @@ meta_window_configure_request (MetaWindow *window,
break;
}
}
+
+ /* If we went full-size for an undecorated window, then enter
+ * fullscreen mode. A hack for lame clients.
+ */
+ if (window->has_fullscreen_func && !window->decorated &&
+ !window->maximized)
+ {
+ const MetaXineramaScreenInfo *xinerama;
+ MetaRectangle outer;
+
+ xinerama = meta_screen_get_xinerama_for_window (window->screen,
+ window);
+
+ meta_window_get_outer_rect (window, &outer);
+
+ if (outer.width >= xinerama->width &&
+ outer.height >= xinerama->height)
+ meta_window_make_fullscreen (window);
+ else
+ {
+ meta_topic (META_DEBUG_GEOMETRY,
+ "Did not fullscreen %s size %dx%d with xinerama %dx%d\n",
+ window->desc,
+ outer.width, outer.height,
+ xinerama->width, xinerama->height);
+ }
+ }
+ else
+ {
+ meta_topic (META_DEBUG_GEOMETRY,
+ "Did not fullscreen %s has_fullscreen = %d decorated = %d maximized = %d\n",
+ window->desc,
+ window->has_fullscreen_func,
+ window->decorated,
+ window->maximized);
+ }
return TRUE;
}
@@ -5226,7 +5262,30 @@ recalc_window_features (MetaWindow *window)
window->has_minimize_func = window->mwm_has_minimize_func;
window->has_maximize_func = window->mwm_has_maximize_func;
window->has_move_func = window->mwm_has_move_func;
- window->has_resize_func = window->mwm_has_resize_func;
+
+ window->has_resize_func = TRUE;
+
+ /* If min_size == max_size, then don't allow resize */
+ if (window->size_hints.min_width == window->size_hints.max_width &&
+ window->size_hints.min_height == window->size_hints.max_height)
+ window->has_resize_func = FALSE;
+ else if (!window->mwm_has_resize_func)
+ {
+ /* We ignore mwm_has_resize_func because WM_NORMAL_HINTS is the
+ * authoritative source for that info. Some apps such as mplayer or
+ * xine disable resize via MWM but not WM_NORMAL_HINTS, but that
+ * leads to e.g. us not fullscreening their windows. Apps that set
+ * MWM but not WM_NORMAL_HINTS are basically broken. We complain
+ * about these apps but make them work.
+ */
+
+ meta_warning (_("Window %s sets an MWM hint indicating it isn't resizable, but sets min size %d x %d and max size %d x %d; this doesn't make much sense.\n"),
+ window->desc,
+ window->size_hints.min_width,
+ window->size_hints.min_height,
+ window->size_hints.max_width,
+ window->size_hints.max_height);
+ }
window->has_shade_func = TRUE;
window->has_fullscreen_func = TRUE;
@@ -5277,27 +5336,30 @@ recalc_window_features (MetaWindow *window)
window->has_move_func = FALSE;
window->has_resize_func = FALSE;
window->has_maximize_func = FALSE;
- }
-
- /* If min_size == max_size, then don't allow resize */
- if (window->size_hints.min_width == window->size_hints.max_width &&
- window->size_hints.min_height == window->size_hints.max_height)
- window->has_resize_func = FALSE;
-
- /* don't allow fullscreen if we can't resize, unless the size
- * is entire screen size (kind of broken, because we
- * actually fullscreen to xinerama head size not screen size)
- */
+ }
+
if (!window->has_resize_func)
- {
+ {
window->has_maximize_func = FALSE;
-
+
+ /* don't allow fullscreen if we can't resize, unless the size
+ * is entire screen size (kind of broken, because we
+ * actually fullscreen to xinerama head size not screen size)
+ */
if (window->size_hints.min_width == window->screen->width &&
window->size_hints.min_height == window->screen->height &&
!window->decorated)
; /* leave fullscreen available */
else
window->has_fullscreen_func = FALSE;
+
+ meta_topic (META_DEBUG_WINDOW_OPS,
+ "Window %s not resizable, maximizable = %d fullscreenable = %d min size %dx%d max size %dx%d\n",
+ window->desc, window->has_maximize_func, window->has_fullscreen_func,
+ window->size_hints.min_width,
+ window->size_hints.min_height,
+ window->size_hints.max_width,
+ window->size_hints.max_height);
}
/* no shading if not decorated */