From f8ef369e7844fcfec03ae45c22ab77b61073a716 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 3 Sep 2004 01:27:57 +0000 Subject: [PATCH] List the three theme gtkrc files separately, zip doesn't do anything if 2004-09-03 Tor Lillqvist * gtk-zip.sh.in: List the three theme gtkrc files separately, zip doesn't do anything if one of the files on its command line doesn't exist. Handle changes of screen resolution on Win32. (#151581, reported by Arjohn Kampman) * gdk/win32/gdkwindow-win32.c (_gdk_windowing_window_init, _gdk_root_window_size_init): Factor out setting the root window's size (as the size of the union of all monitors) to a new function. * gdk/win32/gdkdisplay-win32.c (gdk_display_open, _gdk_monitor_init): Factor out the monitor query to a new function. * gdk/win32/gdkprivate-win32.h: Declare above new functions. * gdk/win32/gdkevents-win32.c (gdk_event_translate, handle_display_change): Handle WM_DISPLAYCHANGE by calling the above two functions, and emitting the "size_changed" signal on our (only) GdkScreen. --- ChangeLog | 26 ++++++++++++++++++++- ChangeLog.pre-2-10 | 26 ++++++++++++++++++++- ChangeLog.pre-2-6 | 26 ++++++++++++++++++++- ChangeLog.pre-2-8 | 26 ++++++++++++++++++++- gdk/win32/gdkdisplay-win32.c | 44 ++++++++++++++++++++++-------------- gdk/win32/gdkevents-win32.c | 13 +++++++++++ gdk/win32/gdkglobals-win32.c | 2 +- gdk/win32/gdkprivate-win32.h | 2 ++ gdk/win32/gdkwindow-win32.c | 29 +++++++++++++++--------- gtk-zip.sh.in | 4 +++- 10 files changed, 164 insertions(+), 34 deletions(-) diff --git a/ChangeLog b/ChangeLog index f2ccba73a..e9889d8a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,27 @@ +2004-09-03 Tor Lillqvist + + * gtk-zip.sh.in: List the three theme gtkrc files separately, zip + doesn't do anything if one of the files on its command line + doesn't exist. + + Handle changes of screen resolution on Win32. (#151581, reported by + Arjohn Kampman) + + * gdk/win32/gdkwindow-win32.c (_gdk_windowing_window_init, + _gdk_root_window_size_init): Factor out setting the root window's + size (as the size of the union of all monitors) to a new function. + + * gdk/win32/gdkdisplay-win32.c (gdk_display_open, + _gdk_monitor_init): Factor out the monitor query to a new + function. + + * gdk/win32/gdkprivate-win32.h: Declare above new functions. + + * gdk/win32/gdkevents-win32.c (gdk_event_translate, + handle_display_change): Handle WM_DISPLAYCHANGE by calling the + above two functions, and emitting the "size_changed" signal on our + (only) GdkScreen. + 2004-09-01 Matthias Clasen * gtk/gtkcombobox.c (gtk_combo_box_get_popup_accessible): @@ -78,7 +102,7 @@ Tue Aug 31 17:07:41 2004 Jonathan Blandford 2004-08-28 Robert Ögren On Win32, do not produce tablet motion or button events while a - window is being moved or resized. (#151090, reported by Shaneyfelt) + window is being moved or resized. (#151090, reported by Shaneyfelt) * gdk/win32/gdkprivate-win32.h * gdk/win32/gdkglobals-win32.c diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index f2ccba73a..e9889d8a8 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,27 @@ +2004-09-03 Tor Lillqvist + + * gtk-zip.sh.in: List the three theme gtkrc files separately, zip + doesn't do anything if one of the files on its command line + doesn't exist. + + Handle changes of screen resolution on Win32. (#151581, reported by + Arjohn Kampman) + + * gdk/win32/gdkwindow-win32.c (_gdk_windowing_window_init, + _gdk_root_window_size_init): Factor out setting the root window's + size (as the size of the union of all monitors) to a new function. + + * gdk/win32/gdkdisplay-win32.c (gdk_display_open, + _gdk_monitor_init): Factor out the monitor query to a new + function. + + * gdk/win32/gdkprivate-win32.h: Declare above new functions. + + * gdk/win32/gdkevents-win32.c (gdk_event_translate, + handle_display_change): Handle WM_DISPLAYCHANGE by calling the + above two functions, and emitting the "size_changed" signal on our + (only) GdkScreen. + 2004-09-01 Matthias Clasen * gtk/gtkcombobox.c (gtk_combo_box_get_popup_accessible): @@ -78,7 +102,7 @@ Tue Aug 31 17:07:41 2004 Jonathan Blandford 2004-08-28 Robert Ögren On Win32, do not produce tablet motion or button events while a - window is being moved or resized. (#151090, reported by Shaneyfelt) + window is being moved or resized. (#151090, reported by Shaneyfelt) * gdk/win32/gdkprivate-win32.h * gdk/win32/gdkglobals-win32.c diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index f2ccba73a..e9889d8a8 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,27 @@ +2004-09-03 Tor Lillqvist + + * gtk-zip.sh.in: List the three theme gtkrc files separately, zip + doesn't do anything if one of the files on its command line + doesn't exist. + + Handle changes of screen resolution on Win32. (#151581, reported by + Arjohn Kampman) + + * gdk/win32/gdkwindow-win32.c (_gdk_windowing_window_init, + _gdk_root_window_size_init): Factor out setting the root window's + size (as the size of the union of all monitors) to a new function. + + * gdk/win32/gdkdisplay-win32.c (gdk_display_open, + _gdk_monitor_init): Factor out the monitor query to a new + function. + + * gdk/win32/gdkprivate-win32.h: Declare above new functions. + + * gdk/win32/gdkevents-win32.c (gdk_event_translate, + handle_display_change): Handle WM_DISPLAYCHANGE by calling the + above two functions, and emitting the "size_changed" signal on our + (only) GdkScreen. + 2004-09-01 Matthias Clasen * gtk/gtkcombobox.c (gtk_combo_box_get_popup_accessible): @@ -78,7 +102,7 @@ Tue Aug 31 17:07:41 2004 Jonathan Blandford 2004-08-28 Robert Ögren On Win32, do not produce tablet motion or button events while a - window is being moved or resized. (#151090, reported by Shaneyfelt) + window is being moved or resized. (#151090, reported by Shaneyfelt) * gdk/win32/gdkprivate-win32.h * gdk/win32/gdkglobals-win32.c diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index f2ccba73a..e9889d8a8 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,27 @@ +2004-09-03 Tor Lillqvist + + * gtk-zip.sh.in: List the three theme gtkrc files separately, zip + doesn't do anything if one of the files on its command line + doesn't exist. + + Handle changes of screen resolution on Win32. (#151581, reported by + Arjohn Kampman) + + * gdk/win32/gdkwindow-win32.c (_gdk_windowing_window_init, + _gdk_root_window_size_init): Factor out setting the root window's + size (as the size of the union of all monitors) to a new function. + + * gdk/win32/gdkdisplay-win32.c (gdk_display_open, + _gdk_monitor_init): Factor out the monitor query to a new + function. + + * gdk/win32/gdkprivate-win32.h: Declare above new functions. + + * gdk/win32/gdkevents-win32.c (gdk_event_translate, + handle_display_change): Handle WM_DISPLAYCHANGE by calling the + above two functions, and emitting the "size_changed" signal on our + (only) GdkScreen. + 2004-09-01 Matthias Clasen * gtk/gtkcombobox.c (gtk_combo_box_get_popup_accessible): @@ -78,7 +102,7 @@ Tue Aug 31 17:07:41 2004 Jonathan Blandford 2004-08-28 Robert Ögren On Win32, do not produce tablet motion or button events while a - window is being moved or resized. (#151090, reported by Shaneyfelt) + window is being moved or resized. (#151090, reported by Shaneyfelt) * gdk/win32/gdkprivate-win32.h * gdk/win32/gdkglobals-win32.c diff --git a/gdk/win32/gdkdisplay-win32.c b/gdk/win32/gdkdisplay-win32.c index 6d0e9d4ec..16a512725 100644 --- a/gdk/win32/gdkdisplay-win32.c +++ b/gdk/win32/gdkdisplay-win32.c @@ -102,23 +102,21 @@ enum_monitor (HMONITOR hmonitor, } #endif /* HAVE_MONITOR_INFO */ -GdkDisplay * -gdk_display_open (const gchar *display_name) +void +_gdk_monitor_init (void) { - HMODULE user32; - - if (_gdk_display != NULL) - return NULL; /* single display only */ +#ifdef HAVE_MONITOR_INFO + static HMODULE user32 = NULL; - _gdk_display = g_object_new (GDK_TYPE_DISPLAY, NULL); - _gdk_screen = g_object_new (GDK_TYPE_SCREEN, NULL); + if (user32 == NULL) + { + user32 = GetModuleHandle ("user32.dll"); -#ifdef HAVE_MONITOR_INFO - user32 = GetModuleHandle ("user32.dll"); - g_assert (user32 != NULL); + g_assert (user32 != NULL); - p_EnumDisplayMonitors = (t_EnumDisplayMonitors) GetProcAddress (user32, "EnumDisplayMonitors"); - p_GetMonitorInfoA = (t_GetMonitorInfoA) GetProcAddress (user32, "GetMonitorInfoA"); + p_EnumDisplayMonitors = (t_EnumDisplayMonitors) GetProcAddress (user32, "EnumDisplayMonitors"); + p_GetMonitorInfoA = (t_GetMonitorInfoA) GetProcAddress (user32, "GetMonitorInfoA"); + } if (p_EnumDisplayMonitors != NULL && p_GetMonitorInfoA != NULL) { @@ -128,10 +126,11 @@ gdk_display_open (const gchar *display_name) (*p_EnumDisplayMonitors) (NULL, NULL, count_monitor, (LPARAM) &_gdk_num_monitors); - _gdk_monitors = g_new (GdkRectangle, _gdk_num_monitors); + _gdk_monitors = g_renew (GdkRectangle, _gdk_monitors, _gdk_num_monitors); + index = 0; (*p_EnumDisplayMonitors) (NULL, NULL, enum_monitor, (LPARAM) &index); -#if 1 + _gdk_offset_x = G_MININT; _gdk_offset_y = G_MININT; @@ -154,7 +153,6 @@ gdk_display_open (const gchar *display_name) _gdk_monitors[i].height, _gdk_monitors[i].x, _gdk_monitors[i].y)); } -#endif } else #endif /* HAVE_MONITOR_INFO */ @@ -162,7 +160,7 @@ gdk_display_open (const gchar *display_name) unsigned int width, height; _gdk_num_monitors = 1; - _gdk_monitors = g_new (GdkRectangle, 1); + _gdk_monitors = g_renew (GdkRectangle, _gdk_monitors, 1); width = GetSystemMetrics (SM_CXSCREEN); height = GetSystemMetrics (SM_CYSCREEN); @@ -175,6 +173,18 @@ gdk_display_open (const gchar *display_name) _gdk_offset_y = 0; } +} + +GdkDisplay * +gdk_display_open (const gchar *display_name) +{ + if (_gdk_display != NULL) + return NULL; /* single display only */ + + _gdk_display = g_object_new (GDK_TYPE_DISPLAY, NULL); + _gdk_screen = g_object_new (GDK_TYPE_SCREEN, NULL); + + _gdk_monitor_init (); _gdk_visual_init (); gdk_screen_set_default_colormap (_gdk_screen, gdk_screen_get_system_colormap (_gdk_screen)); diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c index e1ee43202..a7c20f7e7 100644 --- a/gdk/win32/gdkevents-win32.c +++ b/gdk/win32/gdkevents-win32.c @@ -2057,6 +2057,14 @@ resize_timer_proc (HWND hwnd, handle_stuff_while_moving_or_resizing (); } +static void +handle_display_change (void) +{ + _gdk_monitor_init (); + _gdk_root_window_size_init (); + g_signal_emit_by_name (_gdk_screen, "size_changed"); +} + static gboolean gdk_event_translate (GdkDisplay *display, MSG *msg, @@ -3275,6 +3283,11 @@ gdk_event_translate (GdkDisplay *display, return_val = TRUE; break; + case WM_DISPLAYCHANGE: + handle_display_change (); + break; + + #ifdef HAVE_WINTAB /* Handle WINTAB events here, as we know that gdkinput.c will * use the fixed WT_DEFBASE as lcMsgBase, and we thus can use the diff --git a/gdk/win32/gdkglobals-win32.c b/gdk/win32/gdkglobals-win32.c index 3c62647cf..aeb6ec526 100644 --- a/gdk/win32/gdkglobals-win32.c +++ b/gdk/win32/gdkglobals-win32.c @@ -34,7 +34,7 @@ GdkScreen *_gdk_screen = NULL; GdkWindow *_gdk_parent_root = NULL; gint _gdk_num_monitors; -GdkRectangle *_gdk_monitors; +GdkRectangle *_gdk_monitors = NULL; gint _gdk_offset_x, _gdk_offset_y; diff --git a/gdk/win32/gdkprivate-win32.h b/gdk/win32/gdkprivate-win32.h index 78ce8e873..2cfc89910 100644 --- a/gdk/win32/gdkprivate-win32.h +++ b/gdk/win32/gdkprivate-win32.h @@ -502,6 +502,8 @@ extern gboolean _sizemove_in_progress; /* Initialization */ void _gdk_windowing_window_init (void); +void _gdk_root_window_size_init (void); +void _gdk_monitor_init(void); void _gdk_visual_init (void); void _gdk_dnd_init (void); void _gdk_windowing_image_init (void); diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c index 7c4c88985..5fe64b7e9 100644 --- a/gdk/win32/gdkwindow-win32.c +++ b/gdk/win32/gdkwindow-win32.c @@ -301,20 +301,32 @@ gdk_window_impl_win32_get_visible_region (GdkDrawable *drawable) return gdk_region_rectangle (&result_rect); } +void +_gdk_root_window_size_init (void) +{ + GdkWindowImplWin32 *impl; + GdkRectangle rect; + int i; + + impl = GDK_WINDOW_IMPL_WIN32 (((GdkWindowObject *) _gdk_parent_root)->impl); + rect = _gdk_monitors[0]; + for (i = 1; i < _gdk_num_monitors; i++) + gdk_rectangle_union (&rect, _gdk_monitors+i, &rect); + + impl->width = rect.width; + impl->height = rect.height; +} + void _gdk_windowing_window_init (void) { GdkWindowObject *private; - GdkWindowImplWin32 *impl; GdkDrawableImplWin32 *draw_impl; - GdkRectangle rect; - gint i; g_assert (_gdk_parent_root == NULL); _gdk_parent_root = g_object_new (GDK_TYPE_WINDOW, NULL); private = (GdkWindowObject *)_gdk_parent_root; - impl = GDK_WINDOW_IMPL_WIN32 (private->impl); draw_impl = GDK_DRAWABLE_IMPL_WIN32 (private->impl); draw_impl->handle = _gdk_root_window; @@ -325,13 +337,8 @@ _gdk_windowing_window_init (void) private->window_type = GDK_WINDOW_ROOT; private->depth = gdk_visual_get_system ()->depth; - rect = _gdk_monitors[0]; - for (i = 1; i < _gdk_num_monitors; i++) - gdk_rectangle_union (&rect, _gdk_monitors+i, &rect); - - impl->width = rect.width; - impl->height = rect.height; - + _gdk_root_window_size_init (); + _gdk_window_init_position (GDK_WINDOW (private)); gdk_win32_handle_table_insert (&_gdk_root_window, _gdk_parent_root); diff --git a/gtk-zip.sh.in b/gtk-zip.sh.in index fe2acfb39..2ecd77426 100755 --- a/gtk-zip.sh.in +++ b/gtk-zip.sh.in @@ -22,7 +22,9 @@ EOF zip $ZIP lib/gtk-2.0/@GTK_BINARY_VERSION@/loaders/*.dll lib/gtk-2.0/@GTK_BINARY_VERSION@/immodules/*.dll -zip $ZIP share/themes/{Default,Emacs}/gtk-2.0{,-key}/gtkrc +zip $ZIP share/themes/Default/gtk-2.0/gtkrc +zip $ZIP share/themes/Default/gtk-2.0-key/gtkrc +zip $ZIP share/themes/Emacs/gtk-2.0-key/gtkrc zip -r $ZIP lib/locale/*/LC_MESSAGES/gtk20.mo -- 2.43.2