int is_wide;
} fontinfo[4];
int xpos, ypos, gotpos, gravity;
- GdkCursor *rawcursor, *textcursor, *blankcursor, *currcursor;
+ GdkCursor *rawcursor, *textcursor, *blankcursor, *waitcursor, *currcursor;
GdkColor cols[NALLCOLOURS];
GdkColormap *colmap;
wchar_t *pastein_data;
int width, height;
int ignore_sbar;
int mouseptr_visible;
+ int busy_status;
guint term_paste_idle_id;
int alt_keycode;
int alt_digits;
return FALSE;
}
+static void update_mouseptr(struct gui_data *inst)
+{
+ switch (inst->busy_status) {
+ case BUSY_NOT:
+ if (!inst->mouseptr_visible) {
+ gdk_window_set_cursor(inst->area->window, inst->blankcursor);
+ } else if (send_raw_mouse) {
+ gdk_window_set_cursor(inst->area->window, inst->rawcursor);
+ } else {
+ gdk_window_set_cursor(inst->area->window, inst->textcursor);
+ }
+ break;
+ case BUSY_WAITING: /* XXX can we do better? */
+ case BUSY_CPU:
+ /* We always display these cursors. */
+ gdk_window_set_cursor(inst->area->window, inst->waitcursor);
+ break;
+ default:
+ assert(0);
+ }
+}
+
static void show_mouseptr(struct gui_data *inst, int show)
{
if (!inst->cfg.hide_mouseptr)
show = 1;
- if (show)
- gdk_window_set_cursor(inst->area->window, inst->currcursor);
- else
- gdk_window_set_cursor(inst->area->window, inst->blankcursor);
inst->mouseptr_visible = show;
+ update_mouseptr(inst);
}
void draw_backing_rect(struct gui_data *inst)
inst->exited = TRUE;
if (inst->cfg.close_on_exit == FORCE_ON ||
(inst->cfg.close_on_exit == AUTO && exitcode == 0))
- exit(0); /* just go. */
+ gtk_main_quit(); /* just go */
if (inst->ldisc) {
ldisc_free(inst->ldisc);
inst->ldisc = NULL;
return FALSE;
}
+void set_busy_status(void *frontend, int status)
+{
+ struct gui_data *inst = (struct gui_data *)frontend;
+ inst->busy_status = status;
+ update_mouseptr(inst);
+}
+
/*
* set or clear the "raw mouse message" mode
*/
struct gui_data *inst = (struct gui_data *)frontend;
activate = activate && !inst->cfg.no_mouse_rep;
send_raw_mouse = activate;
- if (send_raw_mouse)
- inst->currcursor = inst->rawcursor;
- else
- inst->currcursor = inst->textcursor;
- show_mouseptr(inst, inst->mouseptr_visible);
+ update_mouseptr(inst);
}
void request_resize(void *frontend, int w, int h)
inst = snew(struct gui_data);
memset(inst, 0, sizeof(*inst));
inst->alt_keycode = -1; /* this one needs _not_ to be zero */
+ inst->busy_status = BUSY_NOT;
/* defer any child exit handling until we're ready to deal with
* it */
inst->textcursor = make_mouse_ptr(inst, GDK_XTERM);
inst->rawcursor = make_mouse_ptr(inst, GDK_LEFT_PTR);
+ inst->waitcursor = make_mouse_ptr(inst, GDK_WATCH);
inst->blankcursor = make_mouse_ptr(inst, -1);
make_mouse_ptr(inst, -2); /* clean up cursor font */
inst->currcursor = inst->textcursor;