Skip to content

Commit

Permalink
gtkvncviewer enhancements
Browse files Browse the repository at this point in the history
Hide "Connecting" dialog in gtkvncviewer once an update is received.

Hide local cusror in gtkvncviewer.
  • Loading branch information
David Verbeiren authored and bk138 committed Jan 10, 2013
1 parent 55bdab0 commit 98d4951
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions client_examples/gtkvncviewer.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
static rfbClient *cl;
static gchar *server_cut_text = NULL;
static gboolean framebuffer_allocated = FALSE;
static GtkWidget *window;
static GtkWidget *dialog_connecting = NULL;

/* Redraw the screen from the backing pixmap */
static gboolean expose_event (GtkWidget *widget,
Expand Down Expand Up @@ -58,6 +60,11 @@ static gboolean expose_event (GtkWidget *widget,
SetFormatAndEncodings (cl);

framebuffer_allocated = TRUE;

/* Also disable local cursor */
GdkCursor* cur = gdk_cursor_new( GDK_BLANK_CURSOR );
gdk_window_set_cursor (gtk_widget_get_window(GTK_WIDGET(window)), cur);
gdk_cursor_unref( cur );
}

gdk_draw_image (GDK_DRAWABLE (widget->window),
Expand Down Expand Up @@ -182,8 +189,6 @@ static void send_crtl_alt_del (GtkMenuItem *menuitem,
SendKeyEvent(cl, XK_Delete, FALSE);
}

GtkWidget *dialog_connecting = NULL;

static void show_connect_window(int argc, char **argv)
{
GtkWidget *label;
Expand Down Expand Up @@ -365,7 +370,6 @@ void quit ()
}

static rfbBool resize (rfbClient *client) {
GtkWidget *window;
GtkWidget *scrolled_window;
GtkWidget *drawing_area=NULL;
static char first=TRUE;
Expand Down Expand Up @@ -453,6 +457,11 @@ static rfbBool resize (rfbClient *client) {
}

static void update (rfbClient *cl, int x, int y, int w, int h) {
if (dialog_connecting != NULL) {
gtk_widget_destroy (dialog_connecting);
dialog_connecting = NULL;
}

GtkWidget *drawing_area = rfbClientGetClientData (cl, gtk_init);

if (drawing_area != NULL)
Expand Down

0 comments on commit 98d4951

Please sign in to comment.