8783 |
gdouble position; |
gdouble position; |
8784 |
gdouble *p; |
gdouble *p; |
8785 |
int diff; |
int diff; |
8786 |
|
|
8787 |
int part = -1, whole = 0, portion = 0; |
int part = -1, whole = 0, portion = 0; |
8788 |
GtkAdjustment *adj = GTK_ADJUSTMENT (widget); |
GtkAdjustment *adj = GTK_ADJUSTMENT (widget); |
8789 |
|
|
8790 |
if (xg_ignore_gtk_scrollbar) return; |
if (xg_ignore_gtk_scrollbar) return; |
8791 |
|
|
8792 |
position = gtk_adjustment_get_value (adj); |
position = gtk_adjustment_get_value (adj); |
8793 |
|
|
8794 |
p = g_object_get_data (G_OBJECT (widget), XG_LAST_SB_DATA); |
p = g_object_get_data (G_OBJECT (widget), XG_LAST_SB_DATA); |
8803 |
*p = position; |
*p = position; |
8804 |
|
|
8805 |
diff = (int) (position - previous); |
diff = (int) (position - previous); |
8806 |
|
|
8807 |
if (diff == (int) adj->step_increment) |
if (diff == (int) adj->step_increment) |
8808 |
{ |
{ |
8809 |
part = scroll_bar_down_arrow; |
part = scroll_bar_down_arrow; |
8831 |
portion = min (position, whole); |
portion = min (position, whole); |
8832 |
bar->dragging = make_number (portion); |
bar->dragging = make_number (portion); |
8833 |
} |
} |
8834 |
|
|
8835 |
if (part >= 0) |
if (part >= 0) |
8836 |
{ |
{ |
8837 |
xg_ignore_next_thumb = 1; |
xg_ignore_next_thumb = 1; |
10221 |
Returns non-zero if the event was filtered, caller shall not process |
Returns non-zero if the event was filtered, caller shall not process |
10222 |
this event further. |
this event further. |
10223 |
Returns zero if event is wasn't filtered. */ |
Returns zero if event is wasn't filtered. */ |
10224 |
|
|
10225 |
#ifdef HAVE_X_I18N |
#ifdef HAVE_X_I18N |
10226 |
static int |
static int |
10227 |
x_filter_event (dpyinfo, event) |
x_filter_event (dpyinfo, event) |
10286 |
|
|
10287 |
|
|
10288 |
/* Handles the XEvent EVENT on display DPYINFO. |
/* Handles the XEvent EVENT on display DPYINFO. |
10289 |
|
|
10290 |
*FINISH is X_EVENT_GOTO_OUT if caller should stop reading events. |
*FINISH is X_EVENT_GOTO_OUT if caller should stop reading events. |
10291 |
*FINISH is zero if caller should continue reading events. |
*FINISH is zero if caller should continue reading events. |
10292 |
*FINISH is X_EVENT_DROP if event should not be passed to the toolkit. |
*FINISH is X_EVENT_DROP if event should not be passed to the toolkit. |
10294 |
Events representing keys are stored in buffer *BUFP_R, |
Events representing keys are stored in buffer *BUFP_R, |
10295 |
which can hold up to *NUMCHARSP characters. |
which can hold up to *NUMCHARSP characters. |
10296 |
We return the number of characters stored into the buffer. */ |
We return the number of characters stored into the buffer. */ |
10297 |
|
|
10298 |
static int |
static int |
10299 |
handle_one_xevent (dpyinfo, eventp, bufp_r, numcharsp, finish) |
handle_one_xevent (dpyinfo, eventp, bufp_r, numcharsp, finish) |
10300 |
struct x_display_info *dpyinfo; |
struct x_display_info *dpyinfo; |
10312 |
XEvent event = *eventp; |
XEvent event = *eventp; |
10313 |
|
|
10314 |
*finish = X_EVENT_NORMAL; |
*finish = X_EVENT_NORMAL; |
10315 |
|
|
10316 |
switch (event.type) |
switch (event.type) |
10317 |
{ |
{ |
10318 |
case ClientMessage: |
case ClientMessage: |
11541 |
} |
} |
11542 |
|
|
11543 |
goto ret; |
goto ret; |
11544 |
|
|
11545 |
out: |
out: |
11546 |
*finish = X_EVENT_GOTO_OUT; |
*finish = X_EVENT_GOTO_OUT; |
11547 |
|
|
11549 |
*bufp_r = bufp; |
*bufp_r = bufp; |
11550 |
*numcharsp = numchars; |
*numcharsp = numchars; |
11551 |
*eventp = event; |
*eventp = event; |
11552 |
|
|
11553 |
return count; |
return count; |
11554 |
} |
} |
11555 |
|
|
11569 |
struct input_event *bufpp = bufp; |
struct input_event *bufpp = bufp; |
11570 |
int numchars = 10; |
int numchars = 10; |
11571 |
int finish = X_EVENT_NORMAL; |
int finish = X_EVENT_NORMAL; |
11572 |
|
|
11573 |
for (dpyinfo = x_display_list; dpyinfo; dpyinfo = dpyinfo->next) |
for (dpyinfo = x_display_list; dpyinfo; dpyinfo = dpyinfo->next) |
11574 |
if (dpyinfo->display == display) |
if (dpyinfo->display == display) |
11575 |
break; |
break; |
11576 |
|
|
11577 |
if (dpyinfo) |
if (dpyinfo) |
11578 |
{ |
{ |
11579 |
int i, events; |
int i, events; |
11681 |
We use a bunch of globals to communicate with our filter function, |
We use a bunch of globals to communicate with our filter function, |
11682 |
that is kind of ugly, but it works. */ |
that is kind of ugly, but it works. */ |
11683 |
current_dpyinfo = dpyinfo; |
current_dpyinfo = dpyinfo; |
11684 |
|
|
11685 |
while (gtk_events_pending ()) |
while (gtk_events_pending ()) |
11686 |
{ |
{ |
11687 |
static int nr = 0; |
static int nr = 0; |
11703 |
while (XPending (dpyinfo->display)) |
while (XPending (dpyinfo->display)) |
11704 |
{ |
{ |
11705 |
int finish; |
int finish; |
11706 |
|
|
11707 |
XNextEvent (dpyinfo->display, &event); |
XNextEvent (dpyinfo->display, &event); |
11708 |
|
|
11709 |
#ifdef HAVE_X_I18N |
#ifdef HAVE_X_I18N |
14105 |
FRAME_GTK_OUTER_WIDGET (f) = 0; |
FRAME_GTK_OUTER_WIDGET (f) = 0; |
14106 |
} |
} |
14107 |
#endif /* USE_GTK */ |
#endif /* USE_GTK */ |
14108 |
|
|
14109 |
if (FRAME_X_WINDOW (f)) |
if (FRAME_X_WINDOW (f)) |
14110 |
XDestroyWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f)); |
XDestroyWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f)); |
14111 |
#endif /* !USE_X_TOOLKIT */ |
#endif /* !USE_X_TOOLKIT */ |
14208 |
int ac = 0; |
int ac = 0; |
14209 |
Dimension widget_width, widget_height; |
Dimension widget_width, widget_height; |
14210 |
#endif |
#endif |
14211 |
|
|
14212 |
Window window = FRAME_OUTER_WINDOW (f); |
Window window = FRAME_OUTER_WINDOW (f); |
14213 |
|
|
14214 |
/* Setting PMaxSize caused various problems. */ |
/* Setting PMaxSize caused various problems. */ |
15198 |
|
|
15199 |
argv[argc++] = "--name"; |
argv[argc++] = "--name"; |
15200 |
argv[argc++] = resource_name; |
argv[argc++] = resource_name; |
15201 |
|
|
15202 |
#ifdef HAVE_X11R5 |
#ifdef HAVE_X11R5 |
15203 |
XSetLocaleModifiers (""); |
XSetLocaleModifiers (""); |
15204 |
#endif |
#endif |
15210 |
xg_initialize (); |
xg_initialize (); |
15211 |
|
|
15212 |
dpy = GDK_DISPLAY (); |
dpy = GDK_DISPLAY (); |
15213 |
|
|
15214 |
/* NULL window -> events for all windows go to our function */ |
/* NULL window -> events for all windows go to our function */ |
15215 |
gdk_window_add_filter (NULL, event_handler_gdk, NULL); |
gdk_window_add_filter (NULL, event_handler_gdk, NULL); |
15216 |
|
|
15226 |
|
|
15227 |
if (! NILP (abs_file) && Ffile_readable_p (abs_file)) |
if (! NILP (abs_file) && Ffile_readable_p (abs_file)) |
15228 |
gtk_rc_parse (SDATA (abs_file)); |
gtk_rc_parse (SDATA (abs_file)); |
15229 |
|
|
15230 |
UNGCPRO; |
UNGCPRO; |
15231 |
} |
} |
15232 |
|
|
15233 |
XSetErrorHandler (x_error_handler); |
XSetErrorHandler (x_error_handler); |
15234 |
XSetIOErrorHandler (x_io_error_quitter); |
XSetIOErrorHandler (x_io_error_quitter); |
15235 |
} |
} |