+2006-03-11 Dom Lachowicz <cinamod@hotmail.com>
+
+ * modules/engines/ms-windows: Speed up the Windows theme
+ considerably (#163724, John Ehresman)
+ Be more careful about setting Pango font descriptions (#333372)
+
2006-03-11 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkrange.c (gtk_range_key_press): Allow to cancel
+2006-03-11 Dom Lachowicz <cinamod@hotmail.com>
+
+ * modules/engines/ms-windows: Speed up the Windows theme
+ considerably (#163724, John Ehresman)
+ Be more careful about setting Pango font descriptions (#333372)
+
2006-03-11 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkrange.c (gtk_range_key_press): Allow to cancel
#include "gtk/gtk.h"
#include "gtk/gtk.h"
-/* #include <gdk/gdkwin32.h> */
+/* #include <gdk/gdkwin32.h> */
#include "gdk/win32/gdkwin32.h"
pt_size = 10;
font = get_family_name (&lf, hDC);
- g_snprintf (buf, bufsiz, "%s %s %s %d", font, style, weight,
- pt_size);
+ if(!(font && *font))
+ return NULL;
+
+ g_snprintf (buf, bufsiz, "%s %s %s %d", font, style, weight, pt_size);
g_free (font);
return buf;
static GModule *this_module = NULL;
static void (*msw_rc_reset_styles) (GtkSettings * settings) = NULL;
+static GdkWindow* hidden_msg_window = NULL;
+
+static GdkWindow*
+create_hidden_msg_window (void)
+{
+ GdkWindowAttr attributes;
+ gint attributes_mask;
+
+ attributes.x = -100;
+ attributes.y = -100;
+ attributes.width = 10;
+ attributes.height = 10;
+ attributes.window_type = GDK_WINDOW_TEMP;
+ attributes.wclass = GDK_INPUT_ONLY;
+ attributes.override_redirect = TRUE;
+ attributes.event_mask = 0;
+
+ attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_NOREDIR;
+
+ return gdk_window_new (gdk_get_default_root_window (),
+ &attributes, attributes_mask);
+}
static GdkFilterReturn
global_filter_func (void *xevent, GdkEvent * event, gpointer data)
}
msw_style_init ();
- gdk_window_add_filter (NULL, global_filter_func, NULL);
+ hidden_msg_window = create_hidden_msg_window ();
+ gdk_window_add_filter (hidden_msg_window, global_filter_func, NULL);
}
G_MODULE_EXPORT void
theme_exit (void)
{
- gdk_window_remove_filter (NULL, global_filter_func, NULL);
+ gdk_window_remove_filter (hidden_msg_window, global_filter_func, NULL);
+ gdk_window_destroy (hidden_msg_window);
+ hidden_msg_window = NULL;
if (this_module)
{
static HINSTANCE uxtheme_dll = NULL;
static HTHEME open_themes[XP_THEME_CLASS__SIZEOF];
+static gboolean use_xp_theme = FALSE;
typedef HRESULT (FAR PASCAL * GetThemeSysFontFunc)
(HTHEME hTheme, int iFontID, OUT LOGFONT * plf);
(DrawThemeParentBackgroundFunc) GetProcAddress (uxtheme_dll,
"DrawThemeParentBackground");
}
+
+ if (is_app_themed_func && is_theme_active_func) {
+ use_xp_theme = (is_app_themed_func () && is_theme_active_func ());
+ }
+ else {
+ use_xp_theme = FALSE;
+ }
}
void
xp_theme_reset (void)
{
xp_theme_close_open_handles ();
+
+ if (is_app_themed_func && is_theme_active_func) {
+ use_xp_theme = (is_app_themed_func () && is_theme_active_func ());
+ }
+ else {
+ use_xp_theme = FALSE;
+ }
}
void
FreeLibrary (uxtheme_dll);
uxtheme_dll = NULL;
+ use_xp_theme = FALSE;
is_app_themed_func = NULL;
is_theme_active_func = NULL;
gboolean
xp_theme_is_active (void)
{
- gboolean active = FALSE;
-
- if (is_app_themed_func)
- {
- active = (*is_app_themed_func) ();
-
- if (active && is_theme_active_func)
- {
- active = (*is_theme_active_func) ();
- }
- }
-
- return active;
+ return use_xp_theme;
}
gboolean