[PATCH 2/6] clients/view: Remove unnecessary variables

Tim Wiederhake twied at gmx.net
Tue Jan 25 13:21:56 PST 2011


---
 clients/view.c |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)

diff --git a/clients/view.c b/clients/view.c
index 9e19a5a..cc3206d 100644
--- a/clients/view.c
+++ b/clients/view.c
@@ -45,13 +45,10 @@
 struct view {
 	struct window *window;
 	struct display *display;
-	uint32_t key;
 
-	gchar *filename;
 	PopplerDocument *document;
 	int page;
 	int fullscreen;
-	int focused;
 };
 
 static void
@@ -153,8 +150,6 @@ keyboard_focus_handler(struct window *window,
 		       struct input *device, void *data)
 {
 	struct view *view = data;
-
-	view->focused = (device != NULL);
 	window_schedule_redraw(view->window);
 }
 
@@ -175,23 +170,17 @@ view_create(struct display *display, uint32_t key, const char *filename)
 	title = g_strdup_printf("Wayland View - %s", basename);
 	g_free(basename);
 
-	view->filename = g_strdup(filename);
-
 	view->window = window_create(display, 500, 400);
 	window_set_title(view->window, title);
 	view->display = display;
 
-	/* FIXME: Window uses key 1 for moves, need some kind of
-	 * allocation scheme here.  Or maybe just a real toolkit. */
-	view->key = key + 100;
-
 	window_set_user_data(view->window, view);
 	window_set_redraw_handler(view->window, redraw_handler);
 	window_set_key_handler(view->window, key_handler);
 	window_set_keyboard_focus_handler(view->window,
 					  keyboard_focus_handler);
 
-	view->document = poppler_document_new_from_file(view->filename,
+	view->document = poppler_document_new_from_file(filename,
 							NULL, &error);
 	view->page = 0;
 	view_draw(view);
-- 
1.7.2.3



More information about the wayland-devel mailing list