]> Pileus Git - ~andy/gtk/commitdiff
List the three theme gtkrc files separately, zip doesn't do anything if
authorTor Lillqvist <tml@iki.fi>
Fri, 3 Sep 2004 01:27:57 +0000 (01:27 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Fri, 3 Sep 2004 01:27:57 +0000 (01:27 +0000)
2004-09-03  Tor Lillqvist  <tml@iki.fi>

* 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
ChangeLog.pre-2-10
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/win32/gdkdisplay-win32.c
gdk/win32/gdkevents-win32.c
gdk/win32/gdkglobals-win32.c
gdk/win32/gdkprivate-win32.h
gdk/win32/gdkwindow-win32.c
gtk-zip.sh.in

index f2ccba73a90652dacae64e3eb570694eeff7a4a8..e9889d8a841bbb3a59097b96e0acf4a35fa42c46 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
+2004-09-03  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <mclasen@redhat.com>
 
        * gtk/gtkcombobox.c (gtk_combo_box_get_popup_accessible): 
@@ -78,7 +102,7 @@ Tue Aug 31 17:07:41 2004  Jonathan Blandford  <jrb@redhat.com>
 2004-08-28  Robert Ögren  <gtk@roboros.com>
 
        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
index f2ccba73a90652dacae64e3eb570694eeff7a4a8..e9889d8a841bbb3a59097b96e0acf4a35fa42c46 100644 (file)
@@ -1,3 +1,27 @@
+2004-09-03  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <mclasen@redhat.com>
 
        * gtk/gtkcombobox.c (gtk_combo_box_get_popup_accessible): 
@@ -78,7 +102,7 @@ Tue Aug 31 17:07:41 2004  Jonathan Blandford  <jrb@redhat.com>
 2004-08-28  Robert Ögren  <gtk@roboros.com>
 
        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
index f2ccba73a90652dacae64e3eb570694eeff7a4a8..e9889d8a841bbb3a59097b96e0acf4a35fa42c46 100644 (file)
@@ -1,3 +1,27 @@
+2004-09-03  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <mclasen@redhat.com>
 
        * gtk/gtkcombobox.c (gtk_combo_box_get_popup_accessible): 
@@ -78,7 +102,7 @@ Tue Aug 31 17:07:41 2004  Jonathan Blandford  <jrb@redhat.com>
 2004-08-28  Robert Ögren  <gtk@roboros.com>
 
        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
index f2ccba73a90652dacae64e3eb570694eeff7a4a8..e9889d8a841bbb3a59097b96e0acf4a35fa42c46 100644 (file)
@@ -1,3 +1,27 @@
+2004-09-03  Tor Lillqvist  <tml@iki.fi>
+
+       * 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  <mclasen@redhat.com>
 
        * gtk/gtkcombobox.c (gtk_combo_box_get_popup_accessible): 
@@ -78,7 +102,7 @@ Tue Aug 31 17:07:41 2004  Jonathan Blandford  <jrb@redhat.com>
 2004-08-28  Robert Ögren  <gtk@roboros.com>
 
        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
index 6d0e9d4ec1bf7c0aa7723a23a08e163e2aa86dd0..16a5127254163bb02bd60c37e084594623de1425 100644 (file)
@@ -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));
index e1ee432027ae99161e2f3d9700d687e3783d83c7..a7c20f7e762a29978b563667d9dd8d3155bf7a1d 100644 (file)
@@ -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
index 3c62647cf1827ae5d71d2939057e3e476c58c2d1..aeb6ec52685d5d70966bdcb7ea5f6fedc17277da 100644 (file)
@@ -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;
 
index 78ce8e87395215c17f9eef68010a5bfa1e93a2c2..2cfc899106aad9f179a7a32012b9a457088fce60 100644 (file)
@@ -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);
index 7c4c88985a5812e6280b8748e4e504721dade37f..5fe64b7e9f728fb73089e79486f537297a1ad564 100644 (file)
@@ -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);
index fe2acfb392ec2ae1852e035d27f338149cbf7d07..2ecd774260e8d6163b63362c3592fd2c7c4df526 100755 (executable)
@@ -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