/*fprintf (stderr, "ns_mouse_position: %.0f, %.0f\n", position.x, position.y); */
if (bar_window) *bar_window = Qnil;
- if (part) *part = 0; /*scroll_bar_handle; */
+ if (part) *part = scroll_bar_above_handle;
if (x) XSETINT (*x, lrint (position.x));
if (y) XSETINT (*y, lrint (position.y));
if (time)
*time = dpyinfo->last_mouse_movement_time;
- dpyinfo->last_mouse_scroll_bar = nil;
- }
- else
- {
- /* Clear the mouse-moved flag for every frame on this display. */
- FOR_EACH_FRAME (tail, frame)
- if (FRAME_NS_P (XFRAME (frame))
- && FRAME_NS_DISPLAY (XFRAME (frame)) == FRAME_NS_DISPLAY (*fp))
- XFRAME (frame)->mouse_moved = 0;
-
- dpyinfo->last_mouse_scroll_bar = nil;
- if (dpyinfo->last_mouse_frame
- && FRAME_LIVE_P (dpyinfo->last_mouse_frame))
- f = dpyinfo->last_mouse_frame;
- else
- f = dpyinfo->x_focus_frame ? dpyinfo->x_focus_frame
- : SELECTED_FRAME ();
-
- if (f && FRAME_NS_P (f))
- {
- view = FRAME_NS_VIEW (*fp);
-
- position = [[view window] mouseLocationOutsideOfEventStream];
- position = [view convertPoint: position fromView: nil];
- remember_mouse_glyph (f, position.x, position.y,
- &dpyinfo->last_mouse_glyph);
-
- if (bar_window) *bar_window = Qnil;
- if (part) *part = scroll_bar_above_handle;
-
- if (x) XSETINT (*x, lrint (position.x));
- if (y) XSETINT (*y, lrint (position.y));
- if (time)
- *time = dpyinfo->last_mouse_movement_time;
- *fp = f;
- }
+ *fp = f;
}
unblock_input ();
EmacsScroller *bar;
int window_y, window_height;
int top, left, height, width;
+ BOOL update_p = YES;
/* optimization; display engine sends WAY too many of these.. */
if (!NILP (window->vertical_scroll_bar))
}
else
view->scrollbarsNeedingUpdate--;
+ update_p = NO;
}
}
bar = [[EmacsScroller alloc] initFrame: r window: win];
wset_vertical_scroll_bar (window, make_save_ptr (bar));
+ update_p = YES;
}
else
{
if (oldRect.origin.x != r.origin.x)
ns_clear_frame_area (f, left, top, width, height);
[bar setFrame: r];
+ update_p = YES;
}
}
- [bar setPosition: position portion: portion whole: whole];
+ if (update_p)
+ [bar setPosition: position portion: portion whole: whole];
unblock_input ();
}
#ifdef NS_IMPL_COCOA
- (void)run
{
-#ifndef NSAppKitVersionNumber10_8
-#define NSAppKitVersionNumber10_8 1187
+#ifndef NSAppKitVersionNumber10_9
+#define NSAppKitVersionNumber10_9 1265
#endif
- if (NSAppKitVersionNumber <= NSAppKitVersionNumber10_8)
- {
- [super run];
- return;
- }
+ if ((int)NSAppKitVersionNumber != NSAppKitVersionNumber10_9)
+ {
+ [super run];
+ return;
+ }
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
}
+- (void)dealloc
+{
+ NSTRACE (EmacsScroller_dealloc);
+ if (window)
+ wset_vertical_scroll_bar (window, Qnil);
+ window = 0;
+ [super dealloc];
+}
+
+
- condemn
{
NSTRACE (condemn);
view = (EmacsView *)FRAME_NS_VIEW (frame);
if (view != nil)
view->scrollbarsNeedingUpdate++;
- if (!NILP (win))
- wset_vertical_scroll_bar (XWINDOW (win), Qnil);
- win = Qnil;
[self removeFromSuperview];
[self release];
unblock_input ();