summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2007-10-21 17:55:42 +0200
committerLennart Poettering <lennart@poettering.net>2007-10-21 17:55:42 +0200
commit4f27f3fb077bf0a1fc4c7443390945dfa947f96a (patch)
treefe4dc94e283559de05c2c3e904241b7002cca8e8
parentd06b70d54ee4b3bfd397fc2ebe5fe3eb00d81a7a (diff)
remove a couple of compiler warnings
-rw-r--r--src/lassi-clipboard.c28
-rw-r--r--src/lassi-grab.c118
-rw-r--r--src/lassi-osd.c26
-rw-r--r--src/lassi-prefs.c36
-rw-r--r--src/lassi-server.c7
5 files changed, 107 insertions, 108 deletions
diff --git a/src/lassi-clipboard.c b/src/lassi-clipboard.c
index bdfeff4..270817c 100644
--- a/src/lassi-clipboard.c
+++ b/src/lassi-clipboard.c
@@ -13,11 +13,11 @@ static void targets_received(GtkClipboard *clipboard, GdkAtom *atoms, int n_atom
g_assert(clipboard);
g_assert(i);
- g_debug("recvd targs %p, %i", atoms, n_atoms);
+ g_debug("recvd targs %p, %i", (void*) atoms, n_atoms);
if (!atoms)
return;
-
+
targets = g_new0(char*, n_atoms+1);
for (j = 0, k = 0; j < n_atoms; j++) {
@@ -43,13 +43,13 @@ static void targets_received(GtkClipboard *clipboard, GdkAtom *atoms, int n_atom
g_free(c);
continue;
}
-
+
targets[k++] = c;
}
- g_debug("%p %i", targets, n_atoms);
+ g_debug("%p %i", (void*) targets, n_atoms);
lassi_server_acquire_clipboard(i->server, clipboard == i->primary, targets);
-
+
fail:
g_strfreev(targets);
}
@@ -61,7 +61,7 @@ static void owner_change(GtkClipboard *clipboard, GdkEventOwnerChange *event, gp
g_assert(i);
g_debug("owner change");
-
+
if (event->reason == GDK_OWNER_CHANGE_NEW_OWNER)
gtk_clipboard_request_targets(clipboard, targets_received, i);
else
@@ -81,7 +81,7 @@ static void get_func(GtkClipboard *clipboard, GtkSelectionData *sd, guint info,
t = gdk_atom_name(sd->target);
g_debug("get(%s)", t);
-
+
if (lassi_server_get_clipboard(i->server, clipboard == i->primary, t, &f, &d, &l) >= 0) {
g_debug("successfully got data");
gtk_selection_data_set(sd, sd->target, f, d, l);
@@ -94,7 +94,7 @@ static void get_func(GtkClipboard *clipboard, GtkSelectionData *sd, guint info,
static void clear_func(GtkClipboard *clipboard, gpointer userdata) {
LassiClipboardInfo *i = userdata;
-
+
g_assert(clipboard);
g_assert(i);
@@ -112,7 +112,7 @@ int lassi_clipboard_init(LassiClipboardInfo *i, LassiServer *s) {
i->clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
i->primary = gtk_clipboard_get(GDK_SELECTION_PRIMARY);
-
+
g_signal_connect(i->clipboard, "owner_change", G_CALLBACK(owner_change), i);
g_signal_connect(i->primary, "owner_change", G_CALLBACK(owner_change), i);
return 0;
@@ -120,7 +120,7 @@ int lassi_clipboard_init(LassiClipboardInfo *i, LassiServer *s) {
void lassi_clipboard_done(LassiClipboardInfo *i) {
g_assert(i);
-
+
memset(i, 0, sizeof(*i));
}
@@ -129,7 +129,7 @@ void lassi_clipboard_set(LassiClipboardInfo *i, gboolean primary, char *targets[
gboolean b;
char **t;
GtkTargetEntry *e;
-
+
for (t = targets; *t; t++)
n++;
@@ -140,7 +140,7 @@ void lassi_clipboard_set(LassiClipboardInfo *i, gboolean primary, char *targets[
e[j].info = j;
}
- e[j].target = LASSI_MARKER;
+ e[j].target = (char*) LASSI_MARKER;
e[j].info = j;
g_debug("setting %i targets", n+1);
@@ -163,12 +163,12 @@ int lassi_clipboard_get(LassiClipboardInfo *i, gboolean primary, const char *tar
return -1;
g_assert(sd->length > 0);
-
+
*f = sd->format;
*p = g_memdup(sd->data, sd->length);
*l = sd->length;
gtk_selection_data_free(sd);
-
+
return 0;
}
diff --git a/src/lassi-grab.c b/src/lassi-grab.c
index e2bda77..9c7a685 100644
--- a/src/lassi-grab.c
+++ b/src/lassi-grab.c
@@ -34,7 +34,7 @@ static void move_pointer(LassiGrabInfo *i, int x, int y) {
/* Move the pointer ... */
gdk_display_warp_pointer(i->display, i->screen, x, y);
-
+
i->last_x = x;
i->last_y = y;
}
@@ -43,7 +43,7 @@ static void drop_motion_events(LassiGrabInfo *i) {
XEvent txe;
g_assert(i);
-
+
/* Drop all queued motion events */
while (XCheckTypedEvent(GDK_DISPLAY_XDISPLAY(i->display), MotionNotify, &txe))
;
@@ -52,7 +52,7 @@ static void drop_motion_events(LassiGrabInfo *i) {
static int grab_input(LassiGrabInfo *i, GdkWindow *w) {
g_assert(i);
g_assert(w);
-
+
if (gdk_pointer_grab(w, TRUE,
GDK_POINTER_MOTION_MASK|
GDK_BUTTON_PRESS_MASK|GDK_BUTTON_RELEASE_MASK,
@@ -60,8 +60,8 @@ static int grab_input(LassiGrabInfo *i, GdkWindow *w) {
g_debug("pointer grab failed");
return -1;
}
-
-
+
+
if (gdk_keyboard_grab(w, TRUE, GDK_CURRENT_TIME) != GDK_GRAB_SUCCESS) {
gdk_pointer_ungrab(GDK_CURRENT_TIME);
g_debug("keyboard grab failed");
@@ -74,11 +74,11 @@ static int grab_input(LassiGrabInfo *i, GdkWindow *w) {
/* Now, rebase the pointer, so that we can easily calculate
* relative movements */
move_pointer(i, i->base_x, i->base_y);
-
+
i->grab_window = w;
-
+
i->left_shift = i->right_shift = i->double_shift = FALSE;
-
+
g_debug("Input now grabbed");
}
@@ -93,23 +93,23 @@ int lassi_grab_start(LassiGrabInfo *i, gboolean to_left) {
void lassi_grab_stop(LassiGrabInfo *i, int y) {
int x;
-
+
g_assert(i);
if (!i->grab_window)
return;
-
+
/* Move the pointer back into our screen */
if (y >= 0 && y < 0xFFFF) {
/* We received a valid y coordinate, so let's use it */
y = global2local(i, y);
-
+
if (i->grab_window == i->left_window)
x = TRIGGER_WIDTH;
else
x = gdk_screen_get_width(i->screen)-TRIGGER_WIDTH-1;
-
+
} else {
/* We received an invlid y coordinate, so let's center the
@@ -117,16 +117,16 @@ void lassi_grab_stop(LassiGrabInfo *i, int y) {
x = i->base_x;
y = i->base_y;
}
-
+
move_pointer(i, x, y);
gdk_keyboard_ungrab(GDK_CURRENT_TIME);
gdk_pointer_ungrab(GDK_CURRENT_TIME);
drop_motion_events(i);
-
+
i->grab_window = NULL;
-
+
g_debug("Input now ungrabbed");
XTestGrabControl(GDK_DISPLAY_XDISPLAY(i->display), True);
@@ -136,47 +136,47 @@ static void handle_motion(LassiGrabInfo *i, int x, int y) {
int dx, dy;
int r;
int w, h;
-
+
dx = x - i->last_x;
dy = y - i->last_y;
-
+
i->last_x = x;
i->last_y = y;
-
+
/* g_debug("rel motion %i %i", dx, dy); */
w = gdk_screen_get_width(i->screen);
h = gdk_screen_get_height(i->screen);
-
+
if (x <= w/10 || y <= h/10 ||
x >= (w*9)/10 || y >= (h*9)/10) {
-
+
XEvent txe;
-
+
/* Pointer is too near to the edges, move cursor
* back to center, so that further movements are
* not clipped */
-
- g_debug("centering");
-
+
+ g_debug("centering");
+
/* First, make sure there is no further motion event in the queue */
while (XCheckTypedEvent(GDK_DISPLAY_XDISPLAY(i->display), MotionNotify, &txe)) {
dx += txe.xmotion.x - i->last_x;
dy += txe.xmotion.y - i->last_y;
-
+
i->last_x = txe.xmotion.x;
i->last_y = txe.xmotion.y;
}
-
- move_pointer(i, i->base_x, i->base_y);
+
+ move_pointer(i, i->base_x, i->base_y);
}
-
+
/* Filter out non-existant or too large motions */
if ((dx != 0 || dy != 0) &&
((abs(dx) <= (w*9)/20) && (abs(dy) <= (h*9)/20))) {
-
+
/* g_debug("sending motion"); */
-
+
/* Send the event */
r = lassi_server_motion_event(i->server, dx, dy);
g_assert(r >= 0);
@@ -191,12 +191,12 @@ static GdkFilterReturn filter_func(GdkXEvent *gxe, GdkEvent *event, gpointer dat
g_assert(i);
g_assert(xe);
g_assert(event);
-
+
switch (xe->type){
-
+
case EnterNotify: {
XEnterWindowEvent *ewe = (XEnterWindowEvent*) xe;
-
+
if (ewe->mode == NotifyNormal && ewe->state == 0 && !i->grab_window) {
/* g_debug("enter %u %u", ewe->x_root, ewe->y_root); */
@@ -205,7 +205,7 @@ static GdkFilterReturn filter_func(GdkXEvent *gxe, GdkEvent *event, gpointer dat
if (lassi_server_change_grab(i->server, w == i->left_window, local2global(i, ewe->y_root)) >= 0)
grab_input(i, w);
- } else if (i->grab_window)
+ } else if (i->grab_window)
handle_motion(i, ewe->x_root, ewe->y_root);
break;
@@ -219,7 +219,7 @@ static GdkFilterReturn filter_func(GdkXEvent *gxe, GdkEvent *event, gpointer dat
/* g_debug("motion %u %u", me->x_root, me->y_root); */
handle_motion(i, me->x_root, me->y_root);
}
-
+
break;
case ButtonPress:
@@ -228,7 +228,7 @@ static GdkFilterReturn filter_func(GdkXEvent *gxe, GdkEvent *event, gpointer dat
if (i->grab_window) {
int r;
XButtonEvent *be = (XButtonEvent*) xe;
-
+
/* g_debug("button press/release"); */
handle_motion(i, be->x_root, be->y_root);
@@ -242,14 +242,14 @@ static GdkFilterReturn filter_func(GdkXEvent *gxe, GdkEvent *event, gpointer dat
case KeyRelease:
/* g_debug("raw key"); */
-
+
if (i->grab_window) {
int r;
XKeyEvent *ke = (XKeyEvent *) xe;
KeySym keysym;
keysym = XKeycodeToKeysym(GDK_DISPLAY_XDISPLAY(i->display), ke->keycode, 0);
-
+
if (keysym == XK_Shift_L)
i->left_shift = ke->type == KeyPress;
if (keysym == XK_Shift_R)
@@ -275,7 +275,7 @@ static GdkFilterReturn filter_func(GdkXEvent *gxe, GdkEvent *event, gpointer dat
}
break;
}
-
+
return GDK_FILTER_CONTINUE;
}
@@ -305,11 +305,11 @@ int lassi_grab_init(LassiGrabInfo *i, LassiServer *s) {
bitmap = gdk_bitmap_create_from_data(NULL, cursor_data, 1, 1);
i->empty_cursor = gdk_cursor_new_from_pixmap(bitmap, bitmap, &black, &black, 0, 0);
gdk_pixmap_unref(bitmap);
-
+
/* Create trigger windows */
memset(&wa, 0, sizeof(wa));
-
- wa.title = "Mango Lassi Left";
+
+ wa.title = (char*) "Mango Lassi Left";
wa.event_mask = GDK_POINTER_MOTION_MASK|GDK_BUTTON_PRESS_MASK|GDK_BUTTON_RELEASE_MASK|GDK_KEY_PRESS_MASK|GDK_KEY_RELEASE_MASK|GDK_ENTER_NOTIFY_MASK;
wa.x = 0;
wa.y = gdk_screen_get_height(i->screen)/20;
@@ -324,30 +324,30 @@ int lassi_grab_init(LassiGrabInfo *i, LassiServer *s) {
i->left_window = gdk_window_new(i->root, &wa, GDK_WA_TITLE|GDK_WA_X|GDK_WA_Y|GDK_WA_NOREDIR|GDK_WA_TYPE_HINT|GDK_WA_CURSOR);
gdk_window_set_keep_above(i->left_window, TRUE);
gdk_window_add_filter(i->left_window, filter_func, i);
-
- wa.title = "Mango Lassi Right";
+
+ wa.title = (char*) "Mango Lassi Right";
wa.x = gdk_screen_get_width(i->screen) - TRIGGER_WIDTH;
-
+
i->right_window = gdk_window_new(i->root, &wa, GDK_WA_TITLE|GDK_WA_X|GDK_WA_Y|GDK_WA_NOREDIR|GDK_WA_TYPE_HINT);
gdk_window_set_keep_above(i->right_window, TRUE);
gdk_window_add_filter(i->right_window, filter_func, i);
i->base_x = gdk_screen_get_width(i->screen)/2;
i->base_y = gdk_screen_get_height(i->screen)/2;
-
+
XTestGrabControl(GDK_DISPLAY_XDISPLAY(i->display), True);
-
+
return 0;
}
void lassi_grab_done(LassiGrabInfo *i) {
g_assert(i);
-
+
lassi_grab_stop(i, -1);
-
+
if (i->left_window)
gdk_window_destroy(i->left_window);
-
+
if (i->right_window)
gdk_window_destroy(i->right_window);
@@ -357,9 +357,9 @@ void lassi_grab_done(LassiGrabInfo *i) {
void lassi_grab_enable_triggers(LassiGrabInfo *i, gboolean left, gboolean right) {
g_assert(i);
-
+
g_debug("Showing windows: left=%s, right=%s", left ? "yes" : "no", right ? "yes" : "no");
-
+
if (left)
gdk_window_show(i->left_window);
else
@@ -368,7 +368,7 @@ void lassi_grab_enable_triggers(LassiGrabInfo *i, gboolean left, gboolean right)
if (right)
gdk_window_show(i->right_window);
else
- gdk_window_hide(i->right_window);
+ gdk_window_hide(i->right_window);
}
int lassi_grab_move_pointer_relative(LassiGrabInfo *i, int dx, int dy) {
@@ -376,10 +376,10 @@ int lassi_grab_move_pointer_relative(LassiGrabInfo *i, int dx, int dy) {
if (i->grab_window)
return -1;
-
+
XTestFakeRelativeMotionEvent(GDK_DISPLAY_XDISPLAY(i->display), dx, dy, 0);
XSync(GDK_DISPLAY_XDISPLAY(i->display), False);
-
+
return 0;
}
@@ -390,8 +390,8 @@ int lassi_grab_press_button(LassiGrabInfo *i, unsigned button, gboolean is_press
return -1;
XTestFakeButtonEvent(GDK_DISPLAY_XDISPLAY(i->display), button, is_press, 0);
- XSync(GDK_DISPLAY_XDISPLAY(i->display), False);
-
+ XSync(GDK_DISPLAY_XDISPLAY(i->display), False);
+
return 0;
}
@@ -401,7 +401,7 @@ int lassi_grab_press_key(LassiGrabInfo *i, unsigned key, gboolean is_press) {
return -1;
XTestFakeKeyEvent(GDK_DISPLAY_XDISPLAY(i->display), XKeysymToKeycode(GDK_DISPLAY_XDISPLAY(i->display), key), is_press, 0);
- XSync(GDK_DISPLAY_XDISPLAY(i->display), False);
-
+ XSync(GDK_DISPLAY_XDISPLAY(i->display), False);
+
return 0;
}
diff --git a/src/lassi-osd.c b/src/lassi-osd.c
index ae9a21c..6736a3f 100644
--- a/src/lassi-osd.c
+++ b/src/lassi-osd.c
@@ -12,7 +12,7 @@ int lassi_osd_init(LassiOsdInfo *osd) {
GdkColor color;
guint32 cardinal;
GdkDisplay *display;
-
+
g_assert(osd);
memset(osd, 0, sizeof(*osd));
@@ -38,13 +38,13 @@ int lassi_osd_init(LassiOsdInfo *osd) {
hbox = gtk_hbox_new(0, 0);
gtk_container_set_border_width(GTK_CONTAINER(hbox), 8);
-
+
gtk_box_pack_start(GTK_BOX(hbox), osd->left_icon, FALSE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(hbox), osd->label, TRUE, TRUE, 0);
gtk_box_pack_end(GTK_BOX(hbox), osd->right_icon, FALSE, TRUE, 0);
gtk_container_add(GTK_CONTAINER(osd->window), hbox);
-
+
gtk_widget_show(hbox);
gtk_widget_show(osd->label);
@@ -64,14 +64,14 @@ int lassi_osd_init(LassiOsdInfo *osd) {
PropModeReplace,
(guchar *) &cardinal, 1);
- g_debug("WINDOW=%p", osd->window);
+ /*g_debug("WINDOW=%p", osd->window);*/
return 0;
}
void lassi_osd_done(LassiOsdInfo *osd) {
g_assert(osd);
-
+
gtk_widget_destroy(osd->window);
memset(osd, 0, sizeof(*osd));
@@ -84,7 +84,7 @@ void lassi_osd_set_text(LassiOsdInfo *osd, const char *text, const char *icon_na
g_assert(osd);
g_assert(osd->window);
- g_debug("WINDOW=%p", osd->window);
+ /*g_debug("WINDOW=%p", osd->window);*/
g_debug("Showing text '%s'", text);
@@ -106,14 +106,14 @@ void lassi_osd_set_text(LassiOsdInfo *osd, const char *text, const char *icon_na
max_width = (gdk_screen_width()*18)/20;
- g_debug("WINDOW=%p", osd->window);
-
+ /*g_debug("WINDOW=%p", osd->window);*/
+
gtk_widget_set_size_request(osd->window, -1, -1);
-
+
gtk_window_get_size(GTK_WINDOW(osd->window), &w, &h);
- g_debug("WINDOW=%p", osd->window);
-
+ /*g_debug("WINDOW=%p", osd->window);*/
+
if (w > max_width) {
gtk_widget_set_size_request(osd->window, max_width, -1);
w = max_width;
@@ -129,7 +129,7 @@ void lassi_osd_set_text(LassiOsdInfo *osd, const char *text, const char *icon_na
gtk_label_set_justify(GTK_LABEL(osd->label), GTK_JUSTIFY_RIGHT);
gtk_window_move(GTK_WINDOW(osd->window), (gdk_screen_width()*19)/20 - w, (gdk_screen_height()*9)/10 - h);
}
-
+
gtk_widget_show(osd->window);
g_debug("osd shown");
@@ -138,7 +138,7 @@ void lassi_osd_set_text(LassiOsdInfo *osd, const char *text, const char *icon_na
void lassi_osd_hide(LassiOsdInfo *osd) {
g_assert(osd);
- gtk_widget_hide(osd->window);
+ gtk_widget_hide(osd->window);
g_debug("osd hidden");
}
diff --git a/src/lassi-prefs.c b/src/lassi-prefs.c
index c3adf68..ecce244 100644
--- a/src/lassi-prefs.c
+++ b/src/lassi-prefs.c
@@ -21,7 +21,7 @@ static void on_add_button_clicked(GtkButton *widget, LassiPrefsInfo *i) {
if (gtk_dialog_run(GTK_DIALOG(d)) == GTK_RESPONSE_ACCEPT) {
char a[AVAHI_ADDRESS_STR_MAX], *t;
-
+
avahi_address_snprint(a, sizeof(a), aui_service_dialog_get_address(AUI_SERVICE_DIALOG(d)));
t = g_strdup_printf("tcp:port=%u,host=%s", aui_service_dialog_get_port(AUI_SERVICE_DIALOG(d)), a);
lassi_server_connect(i->server, t);
@@ -35,12 +35,12 @@ static void on_remove_button_clicked(GtkButton *widget, LassiPrefsInfo *i) {
GtkTreeSelection *selection;
GtkTreeIter iter;
char *id;
-
+
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(i->tree_view));
if (!gtk_tree_selection_get_selected(selection, NULL, &iter))
return;
-
+
gtk_tree_model_get(GTK_TREE_MODEL(i->list_store), &iter, COLUMN_NAME, &id, -1);
if (id) {
lassi_server_disconnect(i->server, id, TRUE);
@@ -49,9 +49,9 @@ static void on_remove_button_clicked(GtkButton *widget, LassiPrefsInfo *i) {
}
static void on_up_button_clicked(GtkButton *widget, LassiPrefsInfo *i) {
- GtkTreeSelection *selection;
- GtkTreeIter iter;
- char *id;
+/* GtkTreeSelection *selection; */
+/* GtkTreeIter iter; */
+/* char *id; */
/* selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(i->tree_view));
@@ -94,17 +94,17 @@ static void update_sensitive(LassiPrefsInfo *i) {
gtk_tree_model_get(GTK_TREE_MODEL(i->list_store), &iter, COLUMN_NAME, &id, -1);
gtk_widget_set_sensitive(i->remove_button, strcmp(id, i->server->id) != 0);
g_free(id);
-
+
path = gtk_tree_model_get_path(GTK_TREE_MODEL(i->list_store), &iter);
is_first = gtk_tree_path_prev(path);
gtk_widget_set_sensitive(i->up_button, is_first);
if (is_first)
gtk_tree_path_next(path);
-
+
gtk_tree_path_next(path);
gtk_widget_set_sensitive(i->down_button, gtk_tree_model_get_iter(GTK_TREE_MODEL(i->list_store), &iter, path));
-
+
gtk_tree_path_free(path);
}
@@ -130,7 +130,7 @@ int lassi_prefs_init(LassiPrefsInfo *i, LassiServer *server) {
i->add_button = glade_xml_get_widget(i->xml, "add_button");
i->remove_button = glade_xml_get_widget(i->xml, "remove_button");
i->tree_view = glade_xml_get_widget(i->xml, "tree_view");
-
+
glade_xml_signal_connect_data(i->xml, "on_add_button_clicked", (GCallback) on_add_button_clicked, i);
glade_xml_signal_connect_data(i->xml, "on_remove_button_clicked", (GCallback) on_remove_button_clicked, i);
glade_xml_signal_connect_data(i->xml, "on_up_button_clicked", (GCallback) on_up_button_clicked, i);
@@ -139,20 +139,20 @@ int lassi_prefs_init(LassiPrefsInfo *i, LassiServer *server) {
glade_xml_signal_connect_data(i->xml, "on_close_button_clicked", (GCallback) on_close_button_clicked, i);
g_signal_connect(G_OBJECT(i->dialog), "delete_event", G_CALLBACK(gtk_widget_hide_on_delete), NULL);
-
+
i->list_store = gtk_list_store_new(N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER);
gtk_tree_view_set_model(GTK_TREE_VIEW(i->tree_view), GTK_TREE_MODEL(i->list_store));
column = gtk_tree_view_column_new_with_attributes("Icon", gtk_cell_renderer_pixbuf_new(), "icon-name", COLUMN_ICON, NULL);
gtk_tree_view_append_column(GTK_TREE_VIEW(i->tree_view), column);
- column = gtk_tree_view_column_new_with_attributes("Name", gtk_cell_renderer_text_new(), "text", COLUMN_NAME, NULL);
+ column = gtk_tree_view_column_new_with_attributes("Name", gtk_cell_renderer_text_new(), "text", COLUMN_NAME, NULL);
gtk_tree_view_append_column(GTK_TREE_VIEW(i->tree_view), column);
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(i->tree_view));
- gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE);
+ gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE);
g_signal_connect(G_OBJECT(selection), "changed", G_CALLBACK(on_selection_changed), i);
-
+
lassi_prefs_update(i);
return 0;
@@ -172,14 +172,14 @@ void lassi_prefs_update(LassiPrefsInfo *i) {
if (gtk_tree_selection_get_selected(selection, NULL, &iter))
gtk_tree_model_get(GTK_TREE_MODEL(i->list_store), &iter, COLUMN_NAME, &selected_item, -1);
-
+
gtk_list_store_clear(GTK_LIST_STORE(i->list_store));
for (l = i->server->order; l; l = l->next) {
if (!lassi_server_is_connected(i->server, l->data))
continue;
-
+
gtk_list_store_append(GTK_LIST_STORE(i->list_store), &iter);
gtk_list_store_set(GTK_LIST_STORE(i->list_store), &iter,
COLUMN_ICON, strcmp(i->server->id, l->data) ? "network-wired" : "user-desktop",
@@ -192,7 +192,7 @@ void lassi_prefs_update(LassiPrefsInfo *i) {
}
g_free(selected_item);
-
+
update_sensitive(i);
}
@@ -207,6 +207,6 @@ void lassi_prefs_done(LassiPrefsInfo *i) {
g_object_unref(G_OBJECT(i->xml));
g_object_unref(G_OBJECT(i->list_store));
-
+
memset(i, 0, sizeof(*i));
}
diff --git a/src/lassi-server.c b/src/lassi-server.c
index f160279..b99164b 100644
--- a/src/lassi-server.c
+++ b/src/lassi-server.c
@@ -362,7 +362,7 @@ int lassi_server_key_event(LassiServer *ls, unsigned key, gboolean is_press) {
return 0;
}
-static void show_welcome(LassiConnection *lc, gboolean connect) {
+static void show_welcome(LassiConnection *lc, gboolean is_connect) {
gboolean to_left;
LassiServer *ls;
char *summary, *body;
@@ -372,7 +372,7 @@ static void show_welcome(LassiConnection *lc, gboolean connect) {
ls = lc->server;
to_left = !!g_list_find(ls->connections_left, lc);
- if (connect) {
+ if (is_connect) {
summary = g_strdup_printf("%s now shares input with this desktop", lc->id);
body = g_strdup_printf("You're now sharing keyboard and mouse with <b>%s</b> which is located to the <b>%s</b>.", lc->id, to_left ? "left" : "right");
} else {
@@ -722,7 +722,6 @@ static int signal_hello(LassiConnection *lc, DBusMessage *m) {
/* Notify new node about old nodes */
for (i = lc->server->connections; i; i = i->next) {
LassiConnection *k = i->data;
- dbus_bool_t b;
if (k == lc || !k->id)
continue;
@@ -1199,7 +1198,7 @@ finish:
return 0;
}
-DBusHandlerResult message_function(DBusConnection *c, DBusMessage *m, void *userdata) {
+static DBusHandlerResult message_function(DBusConnection *c, DBusMessage *m, void *userdata) {
DBusError e;
LassiConnection *lc = userdata;