mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 17:40:40 -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>
|
2001-09-17 Havoc Pennington <hp@pobox.com>
|
||||||
|
|
||||||
* src/Makefile.am (VARIABLES): fix srcdir != builddir glitch
|
* src/Makefile.am (VARIABLES): fix srcdir != builddir glitch
|
||||||
|
@ -2,7 +2,7 @@ AC_INIT(src/display.c)
|
|||||||
|
|
||||||
AM_CONFIG_HEADER(config.h)
|
AM_CONFIG_HEADER(config.h)
|
||||||
|
|
||||||
AM_INIT_AUTOMAKE(metacity, 2.3.8)
|
AM_INIT_AUTOMAKE(metacity, 2.3.13)
|
||||||
|
|
||||||
GETTEXT_PACKAGE=metacity
|
GETTEXT_PACKAGE=metacity
|
||||||
AC_SUBST(GETTEXT_PACKAGE)
|
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 MetaExitCode meta_exit_code = META_EXIT_SUCCESS;
|
||||||
static GMainLoop *meta_main_loop = NULL;
|
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
|
static void
|
||||||
usage (void)
|
usage (void)
|
||||||
{
|
{
|
||||||
@ -165,6 +174,11 @@ main (int argc, char **argv)
|
|||||||
/* must be after UI init so we can override GDK handlers */
|
/* must be after UI init so we can override GDK handlers */
|
||||||
meta_errors_init ();
|
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))
|
if (!meta_display_open (NULL))
|
||||||
meta_exit (META_EXIT_ERROR);
|
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_unref (G_OBJECT (base));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_object_ref (G_OBJECT (default_icon));
|
||||||
|
|
||||||
return 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_unref (G_OBJECT (base));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_object_ref (G_OBJECT (default_icon));
|
||||||
|
|
||||||
return default_icon;
|
return default_icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
23
src/window.c
23
src/window.c
@ -3568,15 +3568,22 @@ get_text_property (MetaDisplay *display,
|
|||||||
|
|
||||||
meta_error_trap_push (display);
|
meta_error_trap_push (display);
|
||||||
|
|
||||||
XGetTextProperty (display->xdisplay,
|
text.nitems = 0;
|
||||||
|
if (XGetTextProperty (display->xdisplay,
|
||||||
xwindow,
|
xwindow,
|
||||||
&text,
|
&text,
|
||||||
atom);
|
atom))
|
||||||
|
{
|
||||||
retval = meta_text_property_to_utf8 (display->xdisplay, &text);
|
retval = meta_text_property_to_utf8 (display->xdisplay, &text);
|
||||||
|
|
||||||
if (text.nitems > 0)
|
if (text.nitems > 0)
|
||||||
XFree (text.value);
|
XFree (text.value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
retval = NULL;
|
||||||
|
meta_verbose ("XGetTextProperty() failed\n");
|
||||||
|
}
|
||||||
|
|
||||||
meta_error_trap_pop (display);
|
meta_error_trap_pop (display);
|
||||||
|
|
||||||
@ -4044,6 +4051,8 @@ replace_icon (MetaWindow *window,
|
|||||||
GdkPixbuf *unscaled,
|
GdkPixbuf *unscaled,
|
||||||
GdkPixbuf *unscaled_mini)
|
GdkPixbuf *unscaled_mini)
|
||||||
{
|
{
|
||||||
|
clear_icon (window);
|
||||||
|
|
||||||
if (gdk_pixbuf_get_width (unscaled) != META_ICON_WIDTH ||
|
if (gdk_pixbuf_get_width (unscaled) != META_ICON_WIDTH ||
|
||||||
gdk_pixbuf_get_height (unscaled) != META_ICON_HEIGHT)
|
gdk_pixbuf_get_height (unscaled) != META_ICON_HEIGHT)
|
||||||
{
|
{
|
||||||
@ -4297,7 +4306,6 @@ update_icon (MetaWindow *window,
|
|||||||
meta_verbose ("No WM_NORMAL_HINTS icon, or failed to retrieve it\n");
|
meta_verbose ("No WM_NORMAL_HINTS icon, or failed to retrieve it\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (try_pixmap_and_mask (window,
|
if (try_pixmap_and_mask (window,
|
||||||
window->kwm_pixmap,
|
window->kwm_pixmap,
|
||||||
window->kwm_mask))
|
window->kwm_mask))
|
||||||
@ -4312,10 +4320,13 @@ update_icon (MetaWindow *window,
|
|||||||
|
|
||||||
/* Fallback to a default icon */
|
/* Fallback to a default icon */
|
||||||
if (window->icon == NULL)
|
if (window->icon == NULL)
|
||||||
{
|
|
||||||
window->icon = meta_ui_get_default_window_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);
|
window->mini_icon = meta_ui_get_default_mini_icon (window->screen->ui);
|
||||||
}
|
|
||||||
|
g_assert (window->icon);
|
||||||
|
g_assert (window->mini_icon);
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user