[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[et-mgmt-tools] [PATCH] virt-viewer: start virt-viewer fullscreen mode



Hi,
this is straight from the "showing a vm at Linuxtag in non-fullscreen
mode looks bad" department. It's against 0.0.3 so not appliable as is
but maybe helpful to somebody else.
 -- Guido
>From f699ef11055ab1dc450a28a4366c3f5eab4620af Mon Sep 17 00:00:00 2001
From: Guido Guenther <agx sigxcpu org>
Date: Wed, 24 Jun 2009 12:29:11 +0200
Subject: [PATCH] hack on fullscreen mode

---
 src/main.c   |   13 ++++++++++---
 src/viewer.h |    2 +-
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/main.c b/src/main.c
index fc186ea..c358a03 100644
--- a/src/main.c
+++ b/src/main.c
@@ -779,7 +779,7 @@ int
 viewer_start (const char *uri, const char *name,
 	      int direct, int waitvnc, int set_verbose,
 	      GtkWidget *(*get_toplevel)(void *), void *data,
-	      int with_menubar)
+	      int with_menubar, int fullscreen)
 {
 	GtkWidget *window;
 	GtkWidget *vnc;
@@ -852,6 +852,8 @@ viewer_start (const char *uri, const char *name,
 	else
 		vnc_display_open_host(VNC_DISPLAY(vnc), host, vncport);
 
+	if (fullscreen)
+		gtk_window_fullscreen(GTK_WINDOW(window));
 	return 0;
 }
 
@@ -894,7 +896,7 @@ int main(int argc, char **argv)
 	char *uri = NULL;
 	char *name = NULL;
 	int opt_ind;
-	const char *sopts = "hVc:";
+	const char *sopts = "fhVc:";
 	static const struct option lopts[] = {
 		{ "help", 0, 0, 'h' },
 		{ "version", 0, 0, 'V' },
@@ -902,12 +904,14 @@ int main(int argc, char **argv)
 		{ "connect", 1, 0, 'c' },
 		{ "wait", 0, 0, 'w' },
 		{ "direct", 0, 0, 'd' },
+		{ "fullscreen", 0, 0, 'f' },
 		{ 0, 0, 0, 0 }
 	};
 	int ch;
 	int direct = 0;
 	int waitvnc = 0;
 	int set_verbose = 0;
+	int fullscreen = 0;
 	int ret;
 
 	while ((ch = getopt_long(argc, argv, sopts, lopts, &opt_ind)) != -1) {
@@ -930,6 +934,9 @@ int main(int argc, char **argv)
 		case 'd':
 			direct = 1;
 			break;
+		case 'f':
+			fullscreen = 1;
+			break;
 		case '?':
 			viewer_help(stderr, argv[0]);
 			return 1;
@@ -945,7 +952,7 @@ int main(int argc, char **argv)
 
 	name = argv[optind];
 	ret = viewer_start (uri, name, direct, waitvnc, set_verbose,
-			    viewer_get_toplevel, NULL, 1);
+			    viewer_get_toplevel, NULL, 1, fullscreen);
 	if (ret != 0) return ret;
 
 	gtk_main();
diff --git a/src/viewer.h b/src/viewer.h
index 59015cc..a68c093 100644
--- a/src/viewer.h
+++ b/src/viewer.h
@@ -23,6 +23,6 @@
 #ifndef VIEWER_H
 #define VIEWER_H
 
-extern int viewer_start (const char *uri, const char *name, int direct, int waitvnc, int set_verbose, GtkWidget *(*get_toplevel)(void *), void *data, int with_menubar);
+extern int viewer_start (const char *uri, const char *name, int direct, int waitvnc, int set_verbose, GtkWidget *(*get_toplevel)(void *), void *data, int with_menubar, int fullscreen);
 
 #endif /* VIEWER_H */
-- 
1.6.3.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]