diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2010-09-11 00:31:45 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2010-09-11 00:31:45 +0200 |
commit | e52eeef895866acae75918ce527ce8abc2ba1326 (patch) | |
tree | 7a6f2e0375eedb38ef3fdd28abaf5ae24f626f74 | |
parent | 12d6a290b7819627ad97e1519e8e95b6f92553c0 (diff) |
misc tweaks.
-rw-r--r-- | gtk/channel-cursor.c | 18 | ||||
-rw-r--r-- | gtk/channel-display.c | 3 | ||||
-rw-r--r-- | gtk/channel-main.c | 2 | ||||
-rw-r--r-- | gtk/spice-widget.c | 27 |
4 files changed, 45 insertions, 5 deletions
diff --git a/gtk/channel-cursor.c b/gtk/channel-cursor.c index 38505f8..306b337 100644 --- a/gtk/channel-cursor.c +++ b/gtk/channel-cursor.c @@ -34,6 +34,21 @@ static void cursor_handle_hide(SpiceChannel *channel, spice_msg_in *in) fprintf(stderr, "%s: TODO\n", __FUNCTION__); } +static void cursor_handle_trail(SpiceChannel *channel, spice_msg_in *in) +{ + fprintf(stderr, "%s: TODO\n", __FUNCTION__); +} + +static void cursor_handle_inval_one(SpiceChannel *channel, spice_msg_in *in) +{ + fprintf(stderr, "%s: TODO\n", __FUNCTION__); +} + +static void cursor_handle_inval_all(SpiceChannel *channel, spice_msg_in *in) +{ + fprintf(stderr, "%s: TODO\n", __FUNCTION__); +} + static spice_msg_handler cursor_handlers[] = { [ SPICE_MSG_SET_ACK ] = base_handle_set_ack, [ SPICE_MSG_PING ] = base_handle_ping, @@ -44,6 +59,9 @@ static spice_msg_handler cursor_handlers[] = { [ SPICE_MSG_CURSOR_SET ] = cursor_handle_set, [ SPICE_MSG_CURSOR_MOVE ] = cursor_handle_move, [ SPICE_MSG_CURSOR_HIDE ] = cursor_handle_hide, + [ SPICE_MSG_CURSOR_TRAIL ] = cursor_handle_trail, + [ SPICE_MSG_CURSOR_INVAL_ONE ] = cursor_handle_inval_one, + [ SPICE_MSG_CURSOR_INVAL_ALL ] = cursor_handle_inval_all, }; spice_channel_info cursor_channel_info = { diff --git a/gtk/channel-display.c b/gtk/channel-display.c index 157c8ee..333c8e2 100644 --- a/gtk/channel-display.c +++ b/gtk/channel-display.c @@ -399,7 +399,8 @@ static void display_handle_draw_invers(SpiceChannel *channel, spice_msg_in *in) static void display_handle_draw_rop3(SpiceChannel *channel, spice_msg_in *in) { - fprintf(stderr, "%s: TODO\n", __FUNCTION__); + SpiceMsgDisplayDrawRop3 *op = spice_msg_in_parsed(in); + DRAW(rop3); } static void display_handle_draw_stroke(SpiceChannel *channel, spice_msg_in *in) diff --git a/gtk/channel-main.c b/gtk/channel-main.c index 29f8905..8c39832 100644 --- a/gtk/channel-main.c +++ b/gtk/channel-main.c @@ -10,7 +10,7 @@ static void set_mouse_mode(SpiceChannel *channel, uint32_t supported, uint32_t c c->main.mouse_mode = current; fprintf(stderr, "%s: %s\n", __FUNCTION__, current == SPICE_MOUSE_MODE_SERVER ? "server" : "client"); - /* send event */ + g_signal_emit(channel, channel_signals[SPICE_MAIN_MOUSE_MODE], 0, current); } /* switch to client mode if possible */ diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c index 366502c..103bcc1 100644 --- a/gtk/spice-widget.c +++ b/gtk/spice-widget.c @@ -242,8 +242,22 @@ static gboolean expose_event(GtkWidget *widget, GdkEventExpose *expose) expose->area.width, expose->area.height); } else { /* complete window update */ - XFillRectangle(d->dpy, gdk_x11_drawable_get_xid(window), - d->gc, 0, 0, d->ww, d->wh); + if (d->ww > d->width || d->wh > d->height) { + if (d->wh > d->height) { + XFillRectangle(d->dpy, gdk_x11_drawable_get_xid(window), + d->gc, 0, 0, d->ww, d->my); + XFillRectangle(d->dpy, gdk_x11_drawable_get_xid(window), + d->gc, 0, d->my + d->height, d->ww, + d->wh - d->my - d->height); + } + if (d->ww > d->width) { + XFillRectangle(d->dpy, gdk_x11_drawable_get_xid(window), + d->gc, 0, 0, d->mx, d->wh); + XFillRectangle(d->dpy, gdk_x11_drawable_get_xid(window), + d->gc, d->mx + d->width, 0, + d->ww - d->mx - d->height, d->wh); + } + } XPutImage(d->dpy, gdk_x11_drawable_get_xid(window), d->gc, d->ximage, 0, 0, d->mx, d->my, d->width, d->height); @@ -292,6 +306,12 @@ static gboolean leave_event(GtkWidget *widget, GdkEventCrossing *crossing G_GNUC return true; } +static gboolean focus_in_event(GtkWidget *widget, GdkEventFocus *focus G_GNUC_UNUSED) +{ + fprintf(stderr, "%s\n", __FUNCTION__); + return true; +} + static gboolean focus_out_event(GtkWidget *widget, GdkEventFocus *focus G_GNUC_UNUSED) { fprintf(stderr, "%s\n", __FUNCTION__); @@ -395,7 +415,7 @@ static gboolean configure_event(GtkWidget *widget, GdkEventConfigure *conf) SpiceDisplay *display = SPICE_DISPLAY(widget); spice_display *d = SPICE_DISPLAY_GET_PRIVATE(display); - if (conf->width != d->ww || conf->height == d->wh) { + if (conf->width != d->ww || conf->height != d->wh) { d->ww = conf->width; d->wh = conf->height; recalc_geometry(widget); @@ -414,6 +434,7 @@ static void spice_display_class_init(SpiceDisplayClass *klass) gtkwidget_class->key_release_event = key_event; gtkwidget_class->enter_notify_event = enter_event; gtkwidget_class->leave_notify_event = leave_event; + gtkwidget_class->focus_in_event = focus_in_event; gtkwidget_class->focus_out_event = focus_out_event; gtkwidget_class->motion_notify_event = motion_event; gtkwidget_class->button_press_event = button_event; |