gdouble position;
gdouble *p;
int diff;
-
+
int part = -1, whole = 0, portion = 0;
GtkAdjustment *adj = GTK_ADJUSTMENT (widget);
-
+
if (xg_ignore_gtk_scrollbar) return;
-
+
position = gtk_adjustment_get_value (adj);
p = g_object_get_data (G_OBJECT (widget), XG_LAST_SB_DATA);
*p = position;
diff = (int) (position - previous);
-
+
if (diff == (int) adj->step_increment)
{
part = scroll_bar_down_arrow;
portion = min (position, whole);
bar->dragging = make_number (portion);
}
-
+
if (part >= 0)
{
xg_ignore_next_thumb = 1;
Returns non-zero if the event was filtered, caller shall not process
this event further.
Returns zero if event is wasn't filtered. */
-
+
#ifdef HAVE_X_I18N
static int
x_filter_event (dpyinfo, event)
/* Handles the XEvent EVENT on display DPYINFO.
-
+
*FINISH is X_EVENT_GOTO_OUT if caller should stop reading events.
*FINISH is zero if caller should continue reading events.
*FINISH is X_EVENT_DROP if event should not be passed to the toolkit.
Events representing keys are stored in buffer *BUFP_R,
which can hold up to *NUMCHARSP characters.
We return the number of characters stored into the buffer. */
-
+
static int
handle_one_xevent (dpyinfo, eventp, bufp_r, numcharsp, finish)
struct x_display_info *dpyinfo;
XEvent event = *eventp;
*finish = X_EVENT_NORMAL;
-
+
switch (event.type)
{
case ClientMessage:
}
goto ret;
-
+
out:
*finish = X_EVENT_GOTO_OUT;
*bufp_r = bufp;
*numcharsp = numchars;
*eventp = event;
-
+
return count;
}
struct input_event *bufpp = bufp;
int numchars = 10;
int finish = X_EVENT_NORMAL;
-
+
for (dpyinfo = x_display_list; dpyinfo; dpyinfo = dpyinfo->next)
if (dpyinfo->display == display)
break;
-
+
if (dpyinfo)
{
int i, events;
We use a bunch of globals to communicate with our filter function,
that is kind of ugly, but it works. */
current_dpyinfo = dpyinfo;
-
+
while (gtk_events_pending ())
{
static int nr = 0;
while (XPending (dpyinfo->display))
{
int finish;
-
+
XNextEvent (dpyinfo->display, &event);
#ifdef HAVE_X_I18N
FRAME_GTK_OUTER_WIDGET (f) = 0;
}
#endif /* USE_GTK */
-
+
if (FRAME_X_WINDOW (f))
XDestroyWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f));
#endif /* !USE_X_TOOLKIT */
int ac = 0;
Dimension widget_width, widget_height;
#endif
-
+
Window window = FRAME_OUTER_WINDOW (f);
/* Setting PMaxSize caused various problems. */
argv[argc++] = "--name";
argv[argc++] = resource_name;
-
+
#ifdef HAVE_X11R5
XSetLocaleModifiers ("");
#endif
xg_initialize ();
dpy = GDK_DISPLAY ();
-
+
/* NULL window -> events for all windows go to our function */
gdk_window_add_filter (NULL, event_handler_gdk, NULL);
if (! NILP (abs_file) && Ffile_readable_p (abs_file))
gtk_rc_parse (SDATA (abs_file));
-
+
UNGCPRO;
}
-
+
XSetErrorHandler (x_error_handler);
XSetIOErrorHandler (x_io_error_quitter);
}