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
text.encoding = XA_STRING;
text.format = 8;
text.nitems = strlen (icon_name);
-#ifdef USE_X_TOOLKIT
- XSetWMIconName (FRAME_X_DISPLAY (f), XtWindow (f->output_data.x->widget),
- &text);
-#else /* not USE_X_TOOLKIT */
- XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &text);
-#endif /* not USE_X_TOOLKIT */
+ XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &text);
}
#else /* not HAVE_X11R4 */
- XSetIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), icon_name);
+ XSetIconName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), icon_name);
#endif /* not HAVE_X11R4 */
if (f->output_data.x->icon_bitmap > 0)
if (f->async_visible)
{
BLOCK_INPUT;
-#ifdef USE_X_TOOLKIT
- XRaiseWindow (FRAME_X_DISPLAY (f), XtWindow (f->output_data.x->widget));
-#else /* not USE_X_TOOLKIT */
- XRaiseWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f));
-#endif /* not USE_X_TOOLKIT */
+ XRaiseWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f));
XFlush (FRAME_X_DISPLAY (f));
UNBLOCK_INPUT;
}
if (f->async_visible)
{
BLOCK_INPUT;
-#ifdef USE_X_TOOLKIT
- XLowerWindow (FRAME_X_DISPLAY (f), XtWindow (f->output_data.x->widget));
-#else /* not USE_X_TOOLKIT */
- XLowerWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f));
-#endif /* not USE_X_TOOLKIT */
+ XLowerWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f));
XFlush (FRAME_X_DISPLAY (f));
UNBLOCK_INPUT;
}
#else /* not USE_X_TOOLKIT */
#ifdef USE_GTK
gtk_widget_show_all (FRAME_GTK_OUTER_WIDGET (f));
+ gtk_window_deiconify (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)));
#else
XMapRaised (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f));
#endif /* not USE_GTK */
{
Window window;
-#ifdef USE_X_TOOLKIT
/* Use the frame's outermost window, not the one we normally draw on. */
- window = XtWindow (f->output_data.x->widget);
-#else /* not USE_X_TOOLKIT */
- window = FRAME_X_WINDOW (f);
-#endif /* not USE_X_TOOLKIT */
+ window = FRAME_OUTER_WINDOW (f);
/* Don't keep the highlight on an invisible frame. */
if (FRAME_X_DISPLAY_INFO (f)->x_highlight_frame == f)
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. */
struct frame *f;
int icon_x, icon_y;
{
-#ifdef USE_X_TOOLKIT
- Window window = XtWindow (f->output_data.x->widget);
-#else
- Window window = FRAME_X_WINDOW (f);
-#endif
+ Window window = FRAME_OUTER_WINDOW (f);
f->output_data.x->wm_hints.flags |= IconPositionHint;
f->output_data.x->wm_hints.icon_x = icon_x;
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);
}