aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2011-07-08 13:22:17 -0700
committerPaul Eggert2011-07-08 13:22:17 -0700
commit67517972df013491db07d81f516c7e56ddc214c8 (patch)
treecbe742bb4f4f075bcbb670ea22dab331053f487a /src
parent2a84b02da8b20138fad7fafdea92d7c8f0564ee0 (diff)
parent1b85461891d3354aef97bec97fab891ddb24e06e (diff)
downloademacs-67517972df013491db07d81f516c7e56ddc214c8.tar.gz
emacs-67517972df013491db07d81f516c7e56ddc214c8.zip
Merge from trunk.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog49
-rw-r--r--src/emacs.c4
-rw-r--r--src/gtkutil.c25
-rw-r--r--src/nsfns.m5
-rw-r--r--src/nsimage.m4
-rw-r--r--src/nsmenu.m2
-rw-r--r--src/nsselect.m6
-rw-r--r--src/nsterm.h35
-rw-r--r--src/nsterm.m25
-rw-r--r--src/w32fns.c9
10 files changed, 143 insertions, 21 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index ccafc9c5963..bd250886ad0 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -9,6 +9,55 @@
9 9
102011-07-08 Jan Djärv <jan.h.d@swipnet.se> 102011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11 11
12 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
13 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
14 wrong (Bug#8591).
15
162011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17
18 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
19 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
20 (xg_hide_tooltip): Fix comment.
21
22 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
23 in registerServicesMenuSendTypes.
24 (validRequestorForSendType): Don't check ns_return_types.
25
26 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
27 ns_return_type.
28
292011-07-08 Jason Rumney <jasonr@gnu.org>
30
31 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
32 frame struct members of non-existent frames (Bug#6284).
33
342011-07-08 Jan Djärv <jan.h.d@swipnet.se>
35
36 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
37 variable firstTime not needed on OSX >= 10.6.
38 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
39 >= 10.5. Use setKnobProportion, setDoubleValue.
40
41 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
42 (MAC_OS_X_VERSION_10_5): Define if not defined.
43 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
44 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
45 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
46
47 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
48 cString and lossyCString on OSX >= 10.4
49
50 * nsmenu.m (fillWithWidgetValue): Don't use depercated method
51 sizeToFit on OSX >= 10.2.
52
53 * nsimage.m (allocInitFromFile): Don't use deprecated method
54 bestRepresentationForDevice on OSX >= 10.6.
55
56 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
57 to avoid warning.
58
59 * emacs.c: Declare unexec_init_emacs_zone.
60
12 * nsgui.h: Fix compiler warning about gnulib redefining verify. 61 * nsgui.h: Fix compiler warning about gnulib redefining verify.
13 62
14 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842). 63 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
diff --git a/src/emacs.c b/src/emacs.c
index e4b3a68a6c1..c1d517900ca 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -129,6 +129,10 @@ Lisp_Object empty_unibyte_string, empty_multibyte_string;
129 on subsequent starts. */ 129 on subsequent starts. */
130int initialized; 130int initialized;
131 131
132#ifdef DARWIN_OS
133extern void unexec_init_emacs_zone (void);
134#endif
135
132#ifdef DOUG_LEA_MALLOC 136#ifdef DOUG_LEA_MALLOC
133/* Preserves a pointer to the memory allocated that copies that 137/* Preserves a pointer to the memory allocated that copies that
134 static data inside glibc's malloc. */ 138 static data inside glibc's malloc. */
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 343fcfa083a..dfc5b63f375 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -633,6 +633,9 @@ qttip_cb (GtkWidget *widget,
633 struct x_output *x = f->output_data.x; 633 struct x_output *x = f->output_data.x;
634 if (x->ttip_widget == NULL) 634 if (x->ttip_widget == NULL)
635 { 635 {
636 GtkWidget *p;
637 GList *list, *iter;
638
636 g_object_set (G_OBJECT (widget), "has-tooltip", FALSE, NULL); 639 g_object_set (G_OBJECT (widget), "has-tooltip", FALSE, NULL);
637 x->ttip_widget = tooltip; 640 x->ttip_widget = tooltip;
638 g_object_ref (G_OBJECT (tooltip)); 641 g_object_ref (G_OBJECT (tooltip));
@@ -640,6 +643,19 @@ qttip_cb (GtkWidget *widget,
640 g_object_ref (G_OBJECT (x->ttip_lbl)); 643 g_object_ref (G_OBJECT (x->ttip_lbl));
641 gtk_tooltip_set_custom (tooltip, x->ttip_lbl); 644 gtk_tooltip_set_custom (tooltip, x->ttip_lbl);
642 x->ttip_window = GTK_WINDOW (gtk_widget_get_toplevel (x->ttip_lbl)); 645 x->ttip_window = GTK_WINDOW (gtk_widget_get_toplevel (x->ttip_lbl));
646
647 /* Change stupid Gtk+ default line wrapping. */
648 p = gtk_widget_get_parent (x->ttip_lbl);
649 list = gtk_container_get_children (GTK_CONTAINER (p));
650 iter;
651 for (iter = list; iter; iter = g_list_next (iter))
652 {
653 GtkWidget *w = GTK_WIDGET (iter->data);
654 if (GTK_IS_LABEL (w))
655 gtk_label_set_line_wrap (GTK_LABEL (w), FALSE);
656 }
657 g_list_free (list);
658
643 /* ATK needs an empty title for some reason. */ 659 /* ATK needs an empty title for some reason. */
644 gtk_window_set_title (x->ttip_window, ""); 660 gtk_window_set_title (x->ttip_window, "");
645 /* Realize so we can safely get screen later on. */ 661 /* Realize so we can safely get screen later on. */
@@ -659,8 +675,8 @@ qttip_cb (GtkWidget *widget,
659 675
660int 676int
661xg_prepare_tooltip (FRAME_PTR f, 677xg_prepare_tooltip (FRAME_PTR f,
662 Lisp_Object string, 678 Lisp_Object string,
663 int *width, 679 int *width,
664 int *height) 680 int *height)
665{ 681{
666#ifndef USE_GTK_TOOLTIP 682#ifndef USE_GTK_TOOLTIP
@@ -697,10 +713,9 @@ xg_prepare_tooltip (FRAME_PTR f,
697 (gtk_widget_get_display (GTK_WIDGET (x->ttip_window))), 713 (gtk_widget_get_display (GTK_WIDGET (x->ttip_window))),
698 "gdk-display-current-tooltip", NULL); 714 "gdk-display-current-tooltip", NULL);
699 715
700 /* Put out dummy widget in so we can get callbacks for unrealize and 716 /* Put our dummy widget in so we can get callbacks for unrealize and
701 hierarchy-changed. */ 717 hierarchy-changed. */
702 gtk_tooltip_set_custom (x->ttip_widget, widget); 718 gtk_tooltip_set_custom (x->ttip_widget, widget);
703
704 gtk_tooltip_set_text (x->ttip_widget, SSDATA (encoded_string)); 719 gtk_tooltip_set_text (x->ttip_widget, SSDATA (encoded_string));
705 gtk_widget_get_preferred_size (GTK_WIDGET (x->ttip_window), NULL, &req); 720 gtk_widget_get_preferred_size (GTK_WIDGET (x->ttip_window), NULL, &req);
706 if (width) *width = req.width; 721 if (width) *width = req.width;
@@ -731,7 +746,7 @@ xg_show_tooltip (FRAME_PTR f, int root_x, int root_y)
731} 746}
732 747
733/* Hide tooltip if shown. Do nothing if not shown. 748/* Hide tooltip if shown. Do nothing if not shown.
734 Return non-zero if tip was hidden, non-ero if not (i.e. not using 749 Return non-zero if tip was hidden, non-zero if not (i.e. not using
735 system tooltips). */ 750 system tooltips). */
736 751
737int 752int
diff --git a/src/nsfns.m b/src/nsfns.m
index d124f61a4f2..0452086201e 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -162,7 +162,7 @@ check_ns_display_info (Lisp_Object frame)
162 struct terminal *t = get_terminal (frame, 1); 162 struct terminal *t = get_terminal (frame, 1);
163 163
164 if (t->type != output_ns) 164 if (t->type != output_ns)
165 error ("Terminal %d is not a Nextstep display", XINT (frame)); 165 error ("Terminal %ld is not a Nextstep display", (long) XINT (frame));
166 166
167 return t->display_info.ns; 167 return t->display_info.ns;
168 } 168 }
@@ -1729,7 +1729,8 @@ terminate Emacs if we can't open the connection.
1729 /* Register our external input/output types, used for determining 1729 /* Register our external input/output types, used for determining
1730 applicable services and also drag/drop eligibility. */ 1730 applicable services and also drag/drop eligibility. */
1731 ns_send_types = [[NSArray arrayWithObjects: NSStringPboardType, nil] retain]; 1731 ns_send_types = [[NSArray arrayWithObjects: NSStringPboardType, nil] retain];
1732 ns_return_types = [[NSArray arrayWithObjects: nil] retain]; 1732 ns_return_types = [[NSArray arrayWithObjects: NSStringPboardType, nil]
1733 retain];
1733 ns_drag_types = [[NSArray arrayWithObjects: 1734 ns_drag_types = [[NSArray arrayWithObjects:
1734 NSStringPboardType, 1735 NSStringPboardType,
1735 NSTabularTextPboardType, 1736 NSTabularTextPboardType,
diff --git a/src/nsimage.m b/src/nsimage.m
index c38cefdc5d5..2cb0c3bff76 100644
--- a/src/nsimage.m
+++ b/src/nsimage.m
@@ -189,7 +189,11 @@ static EmacsImage *ImageList = nil;
189 image = [[EmacsImage alloc] initByReferencingFile: 189 image = [[EmacsImage alloc] initByReferencingFile:
190 [NSString stringWithUTF8String: SDATA (found)]]; 190 [NSString stringWithUTF8String: SDATA (found)]];
191 191
192#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
193 imgRep = [NSBitmapImageRep imageRepWithData:[image TIFFRepresentation]];
194#else
192 imgRep = [image bestRepresentationForDevice: nil]; 195 imgRep = [image bestRepresentationForDevice: nil];
196#endif
193 if (imgRep == nil) 197 if (imgRep == nil)
194 { 198 {
195 [image release]; 199 [image release];
diff --git a/src/nsmenu.m b/src/nsmenu.m
index 0d25b82d5b5..6a9ee7dd4f5 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -695,9 +695,11 @@ set_frame_menubar (struct frame *f, int first_time, int deep_p)
695 if ([[self window] isVisible]) 695 if ([[self window] isVisible])
696 [self sizeToFit]; 696 [self sizeToFit];
697#else 697#else
698#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_2
698 if ([self supermenu] == nil) 699 if ([self supermenu] == nil)
699 [self sizeToFit]; 700 [self sizeToFit];
700#endif 701#endif
702#endif
701} 703}
702 704
703 705
diff --git a/src/nsselect.m b/src/nsselect.m
index aeb2a3e3a99..867cf3252e5 100644
--- a/src/nsselect.m
+++ b/src/nsselect.m
@@ -352,16 +352,22 @@ ns_string_from_pasteboard (id pb)
352 utfStr = [mstr UTF8String]; 352 utfStr = [mstr UTF8String];
353 length = [mstr lengthOfBytesUsingEncoding: NSUTF8StringEncoding]; 353 length = [mstr lengthOfBytesUsingEncoding: NSUTF8StringEncoding];
354 354
355#if ! defined (NS_IMPL_COCOA) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_4
355 if (!utfStr) 356 if (!utfStr)
356 { 357 {
357 utfStr = [mstr cString]; 358 utfStr = [mstr cString];
358 length = strlen (utfStr); 359 length = strlen (utfStr);
359 } 360 }
361#endif
360 } 362 }
361 NS_HANDLER 363 NS_HANDLER
362 { 364 {
363 message1 ("ns_string_from_pasteboard: UTF8String failed\n"); 365 message1 ("ns_string_from_pasteboard: UTF8String failed\n");
366#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
367 utfStr = "Conversion failed";
368#else
364 utfStr = [str lossyCString]; 369 utfStr = [str lossyCString];
370#endif
365 length = strlen (utfStr); 371 length = strlen (utfStr);
366 } 372 }
367 NS_ENDHANDLER 373 NS_ENDHANDLER
diff --git a/src/nsterm.h b/src/nsterm.h
index b442973f0d9..f419391a11e 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -26,10 +26,19 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
26#ifdef HAVE_NS 26#ifdef HAVE_NS
27 27
28#ifdef NS_IMPL_COCOA 28#ifdef NS_IMPL_COCOA
29#ifndef MAC_OS_X_VERSION_10_3
30#define MAC_OS_X_VERSION_10_3 1030
31#endif
32#ifndef MAC_OS_X_VERSION_10_4
33#define MAC_OS_X_VERSION_10_4 1040
34#endif
35#ifndef MAC_OS_X_VERSION_10_5
36#define MAC_OS_X_VERSION_10_5 1050
37#endif
29#ifndef MAC_OS_X_VERSION_10_6 38#ifndef MAC_OS_X_VERSION_10_6
30#define MAC_OS_X_VERSION_10_6 1060 39#define MAC_OS_X_VERSION_10_6 1060
31#endif 40#endif
32#endif 41#endif /* NS_IMPL_COCOA */
33 42
34#ifdef __OBJC__ 43#ifdef __OBJC__
35 44
@@ -61,7 +70,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
61 70
62@class EmacsToolbar; 71@class EmacsToolbar;
63 72
64@interface EmacsView : NSView <NSTextInput> /* 10.6+: NSWindowDelegate */ 73#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
74@interface EmacsView : NSView <NSTextInput, NSWindowDelegate>
75#else
76@interface EmacsView : NSView <NSTextInput>
77#endif
65 { 78 {
66 char *old_title; 79 char *old_title;
67 BOOL windowClosing; 80 BOOL windowClosing;
@@ -112,7 +125,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
112 125
113 ========================================================================== */ 126 ========================================================================== */
114 127
115@interface EmacsMenu : NSMenu /* 10.6+: <NSMenuDelegate> */ 128#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
129@interface EmacsMenu : NSMenu <NSMenuDelegate>
130#else
131@interface EmacsMenu : NSMenu
132#endif
116{ 133{
117 struct frame *frame; 134 struct frame *frame;
118 unsigned long keyEquivModMask; 135 unsigned long keyEquivModMask;
@@ -139,7 +156,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
139 156
140@class EmacsImage; 157@class EmacsImage;
141 158
142@interface EmacsToolbar : NSToolbar /* 10.6+: <NSToolbarDelegate> */ 159#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
160@interface EmacsToolbar : NSToolbar <NSToolbarDelegate>
161#else
162@interface EmacsToolbar : NSToolbar
163#endif
143 { 164 {
144 EmacsView *emacsView; 165 EmacsView *emacsView;
145 NSMutableDictionary *identifierToItem; 166 NSMutableDictionary *identifierToItem;
@@ -182,7 +203,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
182- (Lisp_Object)runDialogAt: (NSPoint)p; 203- (Lisp_Object)runDialogAt: (NSPoint)p;
183@end 204@end
184 205
185@interface EmacsTooltip : NSObject /* 10.6+: <NSWindowDelegate> */ 206#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
207@interface EmacsTooltip : NSObject <NSWindowDelegate>
208#else
209@interface EmacsTooltip : NSObject
210#endif
186 { 211 {
187 NSWindow *win; 212 NSWindow *win;
188 NSTextField *textField; 213 NSTextField *textField;
diff --git a/src/nsterm.m b/src/nsterm.m
index ac95409ee7e..546247ab74a 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -4515,7 +4515,9 @@ ns_term_shutdown (int sig)
4515 unsigned fnKeysym = 0; 4515 unsigned fnKeysym = 0;
4516 int flags; 4516 int flags;
4517 static NSMutableArray *nsEvArray; 4517 static NSMutableArray *nsEvArray;
4518#if !defined (NS_IMPL_COCOA) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
4518 static BOOL firstTime = YES; 4519 static BOOL firstTime = YES;
4520#endif
4519 int left_is_none; 4521 int left_is_none;
4520 4522
4521 NSTRACE (keyDown); 4523 NSTRACE (keyDown);
@@ -4703,13 +4705,15 @@ ns_term_shutdown (int sig)
4703 } 4705 }
4704 } 4706 }
4705 4707
4708
4709#if !defined (NS_IMPL_COCOA) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
4706 /* if we get here we should send the key for input manager processing */ 4710 /* if we get here we should send the key for input manager processing */
4707 if (firstTime && [[NSInputManager currentInputManager] 4711 if (firstTime && [[NSInputManager currentInputManager]
4708 wantsToDelayTextChangeNotifications] == NO) 4712 wantsToDelayTextChangeNotifications] == NO)
4709 fprintf (stderr, 4713 fprintf (stderr,
4710 "Emacs: WARNING: TextInput mgr wants marked text to be permanent!\n"); 4714 "Emacs: WARNING: TextInput mgr wants marked text to be permanent!\n");
4711 firstTime = NO; 4715 firstTime = NO;
4712 4716#endif
4713 if (NS_KEYLOG && !processingCompose) 4717 if (NS_KEYLOG && !processingCompose)
4714 fprintf (stderr, "keyDown: Begin compose sequence.\n"); 4718 fprintf (stderr, "keyDown: Begin compose sequence.\n");
4715 4719
@@ -5366,7 +5370,7 @@ ns_term_shutdown (int sig)
5366 [self allocateGState]; 5370 [self allocateGState];
5367 5371
5368 [NSApp registerServicesMenuSendTypes: ns_send_types 5372 [NSApp registerServicesMenuSendTypes: ns_send_types
5369 returnTypes: ns_return_types]; 5373 returnTypes: nil];
5370 5374
5371 ns_window_num++; 5375 ns_window_num++;
5372 return self; 5376 return self;
@@ -5744,8 +5748,7 @@ ns_term_shutdown (int sig)
5744{ 5748{
5745 NSTRACE (validRequestorForSendType); 5749 NSTRACE (validRequestorForSendType);
5746 if (typeSent != nil && [ns_send_types indexOfObject: typeSent] != NSNotFound 5750 if (typeSent != nil && [ns_send_types indexOfObject: typeSent] != NSNotFound
5747 && (typeReturned == nil 5751 && typeReturned == nil)
5748 || [ns_return_types indexOfObject: typeSent] != NSNotFound))
5749 { 5752 {
5750 if (! NILP (ns_get_local_selection (QPRIMARY, QUTF8_STRING))) 5753 if (! NILP (ns_get_local_selection (QPRIMARY, QUTF8_STRING)))
5751 return self; 5754 return self;
@@ -6066,14 +6069,26 @@ ns_term_shutdown (int sig)
6066 em_whole = whole; 6069 em_whole = whole;
6067 6070
6068 if (portion >= whole) 6071 if (portion >= whole)
6069 [self setFloatValue: 0.0 knobProportion: 1.0]; 6072 {
6073#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
6074 [self setKnobProportion: 1.0];
6075 [self setDoubleValue: 1.0];
6076#else
6077 [self setFloatValue: 0.0 knobProportion: 1.0];
6078#endif
6079 }
6070 else 6080 else
6071 { 6081 {
6072 float pos, por; 6082 float pos, por;
6073 portion = max ((float)whole*min_portion/pixel_height, portion); 6083 portion = max ((float)whole*min_portion/pixel_height, portion);
6074 pos = (float)position / (whole - portion); 6084 pos = (float)position / (whole - portion);
6075 por = (float)portion/whole; 6085 por = (float)portion/whole;
6086#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5
6087 [self setKnobProportion: por];
6088 [self setDoubleValue: pos];
6089#else
6076 [self setFloatValue: pos knobProportion: por]; 6090 [self setFloatValue: pos knobProportion: por];
6091#endif
6077 } 6092 }
6078 return self; 6093 return self;
6079} 6094}
diff --git a/src/w32fns.c b/src/w32fns.c
index cba0b91e685..f48e5764b4c 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -3273,7 +3273,8 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
3273 { 3273 {
3274 /* Free memory used by owner-drawn and help-echo strings. */ 3274 /* Free memory used by owner-drawn and help-echo strings. */
3275 w32_free_menu_strings (hwnd); 3275 w32_free_menu_strings (hwnd);
3276 f->output_data.w32->menubar_active = 0; 3276 if (f)
3277 f->output_data.w32->menubar_active = 0;
3277 menubar_in_use = 0; 3278 menubar_in_use = 0;
3278 } 3279 }
3279 } 3280 }
@@ -3623,10 +3624,10 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
3623 if (LOWORD (lParam) == HTCLIENT) 3624 if (LOWORD (lParam) == HTCLIENT)
3624 { 3625 {
3625 f = x_window_to_frame (dpyinfo, hwnd); 3626 f = x_window_to_frame (dpyinfo, hwnd);
3626 if (f->output_data.w32->hourglass_p && !menubar_in_use 3627 if (f && f->output_data.w32->hourglass_p
3627 && !current_popup_menu) 3628 && !menubar_in_use && !current_popup_menu)
3628 SetCursor (f->output_data.w32->hourglass_cursor); 3629 SetCursor (f->output_data.w32->hourglass_cursor);
3629 else 3630 else if (f)
3630 SetCursor (f->output_data.w32->current_cursor); 3631 SetCursor (f->output_data.w32->current_cursor);
3631 return 0; 3632 return 0;
3632 } 3633 }