summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2010-09-13 11:02:23 +0200
committerGerd Hoffmann <kraxel@redhat.com>2010-09-13 11:02:23 +0200
commit3c30063945d67cd452a59c5445b29492749b623e (patch)
tree5f8872f6ceadbe42a514dc07dabc914af47f49f7
parenta94eaa30d4b799d60eefa2bdf2a8a6cdc9c2c60c (diff)
misc
-rw-r--r--gtk/channel-base.c3
-rw-r--r--gtk/channel-display.c18
-rw-r--r--gtk/spice-channel.c3
-rw-r--r--gtk/spice-widget.c26
-rw-r--r--gtk/spicy.c7
5 files changed, 35 insertions, 22 deletions
diff --git a/gtk/channel-base.c b/gtk/channel-base.c
index 6bf9c62..d13547b 100644
--- a/gtk/channel-base.c
+++ b/gtk/channel-base.c
@@ -50,10 +50,11 @@ void base_handle_notify(SpiceChannel *channel, spice_msg_in *in)
message_str = notify->message;
}
- fprintf(stderr, "%s: channel %u:%u -- %s%s #%u%s%s\n", __FUNCTION__,
+ fprintf(stderr, "%s: channel %u:%u -- %s%s #%u%s%.*s\n", __FUNCTION__,
c->info->type, c->channel_id,
severity, visibility, notify->what,
message_str ? ": " : "",
+ notify->message_len,
message_str ? message_str : "");
}
diff --git a/gtk/channel-display.c b/gtk/channel-display.c
index 333c8e2..0327198 100644
--- a/gtk/channel-display.c
+++ b/gtk/channel-display.c
@@ -368,7 +368,8 @@ static void display_handle_draw_fill(SpiceChannel *channel, spice_msg_in *in)
static void display_handle_draw_opaque(SpiceChannel *channel, spice_msg_in *in)
{
- fprintf(stderr, "%s: TODO\n", __FUNCTION__);
+ SpiceMsgDisplayDrawOpaque *op = spice_msg_in_parsed(in);
+ DRAW(opaque);
}
static void display_handle_draw_copy(SpiceChannel *channel, spice_msg_in *in)
@@ -379,22 +380,26 @@ static void display_handle_draw_copy(SpiceChannel *channel, spice_msg_in *in)
static void display_handle_draw_blend(SpiceChannel *channel, spice_msg_in *in)
{
- fprintf(stderr, "%s: TODO\n", __FUNCTION__);
+ SpiceMsgDisplayDrawBlend *op = spice_msg_in_parsed(in);
+ DRAW(blend);
}
static void display_handle_draw_blackness(SpiceChannel *channel, spice_msg_in *in)
{
- fprintf(stderr, "%s: TODO\n", __FUNCTION__);
+ SpiceMsgDisplayDrawBlackness *op = spice_msg_in_parsed(in);
+ DRAW(blackness);
}
static void display_handle_draw_whiteness(SpiceChannel *channel, spice_msg_in *in)
{
- fprintf(stderr, "%s: TODO\n", __FUNCTION__);
+ SpiceMsgDisplayDrawWhiteness *op = spice_msg_in_parsed(in);
+ DRAW(whiteness);
}
static void display_handle_draw_invers(SpiceChannel *channel, spice_msg_in *in)
{
- fprintf(stderr, "%s: TODO\n", __FUNCTION__);
+ SpiceMsgDisplayDrawInvers *op = spice_msg_in_parsed(in);
+ DRAW(invers);
}
static void display_handle_draw_rop3(SpiceChannel *channel, spice_msg_in *in)
@@ -405,7 +410,8 @@ static void display_handle_draw_rop3(SpiceChannel *channel, spice_msg_in *in)
static void display_handle_draw_stroke(SpiceChannel *channel, spice_msg_in *in)
{
- fprintf(stderr, "%s: TODO\n", __FUNCTION__);
+ SpiceMsgDisplayDrawStroke *op = spice_msg_in_parsed(in);
+ DRAW(stroke);
}
static void display_handle_draw_text(SpiceChannel *channel, spice_msg_in *in)
diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c
index f06e978..bc0e6a9 100644
--- a/gtk/spice-channel.c
+++ b/gtk/spice-channel.c
@@ -105,6 +105,9 @@ static void spice_channel_class_init(SpiceChannelClass *klass)
sw_canvas_init();
quic_init();
rop3_init();
+
+ SSL_library_init();
+ SSL_load_error_strings();
}
static void spice_channel_emit_event(SpiceChannel *channel,
diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
index 868bb1f..f7f7515 100644
--- a/gtk/spice-widget.c
+++ b/gtk/spice-widget.c
@@ -344,20 +344,18 @@ static gboolean expose_event(GtkWidget *widget, GdkEventExpose *expose)
} else {
/* complete window update */
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);
- }
+ int x1 = d->mx;
+ int x2 = d->mx + d->width;
+ int y1 = d->my;
+ int y2 = d->my + d->height;
+ XFillRectangle(d->dpy, gdk_x11_drawable_get_xid(window),
+ d->gc, 0, 0, x1, d->wh);
+ XFillRectangle(d->dpy, gdk_x11_drawable_get_xid(window),
+ d->gc, x2, 0, d->ww - x2, d->wh);
+ XFillRectangle(d->dpy, gdk_x11_drawable_get_xid(window),
+ d->gc, 0, 0, d->ww, y1);
+ XFillRectangle(d->dpy, gdk_x11_drawable_get_xid(window),
+ d->gc, 0, y2, d->ww, d->wh - y2);
}
if (d->have_mitshm) {
XShmPutImage(d->dpy, gdk_x11_drawable_get_xid(window),
diff --git a/gtk/spicy.c b/gtk/spicy.c
index 6be2298..6a7c41c 100644
--- a/gtk/spicy.c
+++ b/gtk/spicy.c
@@ -7,6 +7,7 @@ struct spice_window {
GtkWidget *fstatus, *status;
GtkWidget *menubar, *toolbar;
GtkActionGroup *ag;
+ GtkAccelGroup *accel;
GtkUIManager *ui;
bool fullscreen;
};
@@ -107,6 +108,7 @@ static const GtkActionEntry entries[] = {
.stock_id = GTK_STOCK_QUIT,
.label = "_Quit",
.callback = G_CALLBACK(menu_cb_quit),
+ .accelerator = "", /* none (disable default "<control>Q") */
},{
/* View menu */
@@ -114,6 +116,7 @@ static const GtkActionEntry entries[] = {
.stock_id = GTK_STOCK_FULLSCREEN,
.label = "_Fullscreen",
.callback = G_CALLBACK(menu_cb_fullscreen),
+ .accelerator = "<shift>F11",
},{
/* Help menu */
@@ -161,7 +164,7 @@ static spice_window *create_spice_window(SpiceSession *s, int id)
win->toplevel = gtk_window_new(GTK_WINDOW_TOPLEVEL);
snprintf(title, sizeof(title), "spice display %d", id);
gtk_window_set_title(GTK_WINDOW(win->toplevel), title);
- gtk_window_set_default_size(GTK_WINDOW(win->toplevel), 320, 280);
+ gtk_window_set_default_size(GTK_WINDOW(win->toplevel), 640, 480);
g_signal_connect(G_OBJECT(win->toplevel), "destroy",
G_CALLBACK(destroy_cb), win);
g_signal_connect(G_OBJECT(win->toplevel), "window-state-event",
@@ -172,6 +175,8 @@ static spice_window *create_spice_window(SpiceSession *s, int id)
win->ag = gtk_action_group_new("MenuActions");
gtk_action_group_add_actions(win->ag, entries, G_N_ELEMENTS(entries), win);
gtk_ui_manager_insert_action_group(win->ui, win->ag, 0);
+ win->accel = gtk_ui_manager_get_accel_group(win->ui);
+ gtk_window_add_accel_group(GTK_WINDOW(win->toplevel), win->accel);
err = NULL;
if (!gtk_ui_manager_add_ui_from_string(win->ui, ui_xml, -1, &err)) {