mirror of
https://github.com/brl/mutter.git
synced 2024-11-12 09:16:10 -05:00
ref the returned icon, oops.
2001-09-17 Havoc Pennington <hp@pobox.com> * src/ui.c (meta_ui_get_default_mini_icon): (meta_ui_get_default_window_icon): ref the returned icon, oops. * src/main.c (main): get the GLib warning/error output into the metacity logfile, set warnings to be always fatal * configure.in: bump version to 2.3.13 * src/window.c (get_text_property): hrm, fix bug where we didn't check errors on XGetTextProperty
This commit is contained in:
parent
808d21e857
commit
582a80f518
13
ChangeLog
13
ChangeLog
@ -1,3 +1,16 @@
|
||||
2001-09-17 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* src/ui.c (meta_ui_get_default_mini_icon):
|
||||
(meta_ui_get_default_window_icon): ref the returned icon, oops.
|
||||
|
||||
* src/main.c (main): get the GLib warning/error output into
|
||||
the metacity logfile, set warnings to be always fatal
|
||||
|
||||
* configure.in: bump version to 2.3.13
|
||||
|
||||
* src/window.c (get_text_property): hrm, fix bug where we didn't
|
||||
check errors on XGetTextProperty
|
||||
|
||||
2001-09-17 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* src/Makefile.am (VARIABLES): fix srcdir != builddir glitch
|
||||
|
@ -2,7 +2,7 @@ AC_INIT(src/display.c)
|
||||
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
AM_INIT_AUTOMAKE(metacity, 2.3.8)
|
||||
AM_INIT_AUTOMAKE(metacity, 2.3.13)
|
||||
|
||||
GETTEXT_PACKAGE=metacity
|
||||
AC_SUBST(GETTEXT_PACKAGE)
|
||||
|
14
src/main.c
14
src/main.c
@ -38,6 +38,15 @@
|
||||
static MetaExitCode meta_exit_code = META_EXIT_SUCCESS;
|
||||
static GMainLoop *meta_main_loop = NULL;
|
||||
|
||||
static void
|
||||
log_handler (const gchar *log_domain,
|
||||
GLogLevelFlags log_level,
|
||||
const gchar *message,
|
||||
gpointer user_data)
|
||||
{
|
||||
meta_warning ("GLib log level %d: %s\n", log_level, message);
|
||||
}
|
||||
|
||||
static void
|
||||
usage (void)
|
||||
{
|
||||
@ -164,6 +173,11 @@ main (int argc, char **argv)
|
||||
|
||||
/* must be after UI init so we can override GDK handlers */
|
||||
meta_errors_init ();
|
||||
|
||||
g_log_set_handler (NULL,
|
||||
G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION,
|
||||
log_handler, NULL);
|
||||
g_log_set_always_fatal (G_LOG_LEVEL_MASK);
|
||||
|
||||
if (!meta_display_open (NULL))
|
||||
meta_exit (META_EXIT_ERROR);
|
||||
|
4
src/ui.c
4
src/ui.c
@ -444,6 +444,8 @@ meta_ui_get_default_window_icon (MetaUI *ui)
|
||||
g_object_unref (G_OBJECT (base));
|
||||
}
|
||||
|
||||
g_object_ref (G_OBJECT (default_icon));
|
||||
|
||||
return default_icon;
|
||||
}
|
||||
|
||||
@ -470,6 +472,8 @@ meta_ui_get_default_mini_icon (MetaUI *ui)
|
||||
g_object_unref (G_OBJECT (base));
|
||||
}
|
||||
|
||||
g_object_ref (G_OBJECT (default_icon));
|
||||
|
||||
return default_icon;
|
||||
}
|
||||
|
||||
|
41
src/window.c
41
src/window.c
@ -3568,16 +3568,23 @@ get_text_property (MetaDisplay *display,
|
||||
|
||||
meta_error_trap_push (display);
|
||||
|
||||
XGetTextProperty (display->xdisplay,
|
||||
xwindow,
|
||||
&text,
|
||||
atom);
|
||||
|
||||
retval = meta_text_property_to_utf8 (display->xdisplay, &text);
|
||||
|
||||
if (text.nitems > 0)
|
||||
XFree (text.value);
|
||||
text.nitems = 0;
|
||||
if (XGetTextProperty (display->xdisplay,
|
||||
xwindow,
|
||||
&text,
|
||||
atom))
|
||||
{
|
||||
retval = meta_text_property_to_utf8 (display->xdisplay, &text);
|
||||
|
||||
if (text.nitems > 0)
|
||||
XFree (text.value);
|
||||
}
|
||||
else
|
||||
{
|
||||
retval = NULL;
|
||||
meta_verbose ("XGetTextProperty() failed\n");
|
||||
}
|
||||
|
||||
meta_error_trap_pop (display);
|
||||
|
||||
return retval;
|
||||
@ -4043,7 +4050,9 @@ static void
|
||||
replace_icon (MetaWindow *window,
|
||||
GdkPixbuf *unscaled,
|
||||
GdkPixbuf *unscaled_mini)
|
||||
{
|
||||
{
|
||||
clear_icon (window);
|
||||
|
||||
if (gdk_pixbuf_get_width (unscaled) != META_ICON_WIDTH ||
|
||||
gdk_pixbuf_get_height (unscaled) != META_ICON_HEIGHT)
|
||||
{
|
||||
@ -4296,7 +4305,6 @@ update_icon (MetaWindow *window,
|
||||
{
|
||||
meta_verbose ("No WM_NORMAL_HINTS icon, or failed to retrieve it\n");
|
||||
}
|
||||
|
||||
|
||||
if (try_pixmap_and_mask (window,
|
||||
window->kwm_pixmap,
|
||||
@ -4312,10 +4320,13 @@ update_icon (MetaWindow *window,
|
||||
|
||||
/* Fallback to a default icon */
|
||||
if (window->icon == NULL)
|
||||
{
|
||||
window->icon = meta_ui_get_default_window_icon (window->screen->ui);
|
||||
window->mini_icon = meta_ui_get_default_mini_icon (window->screen->ui);
|
||||
}
|
||||
window->icon = meta_ui_get_default_window_icon (window->screen->ui);
|
||||
|
||||
if (window->mini_icon == NULL)
|
||||
window->mini_icon = meta_ui_get_default_mini_icon (window->screen->ui);
|
||||
|
||||
g_assert (window->icon);
|
||||
g_assert (window->mini_icon);
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user