mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/virt-viewer
synced 2025-12-30 10:03:47 +00:00
Drop basic fullscreen mode
Remove the distinction between --full-screen and --full-screen=auto-conf. Just make --full-screen behave like auto-conf did. There's really no advantage to having two slightly different fullscreen startup modes.
This commit is contained in:
parent
8565501b1e
commit
bd914bdea2
@ -40,14 +40,14 @@ Display information about the connection
|
||||
|
||||
Zoom level of the display window in percentage. Range 10-200.
|
||||
|
||||
=item -f, --full-screen=<auto-conf>
|
||||
=item -f, --full-screen
|
||||
|
||||
Start with the windows maximized to fullscreen.
|
||||
|
||||
If the argument 'auto-conf' is given, the remote display will be
|
||||
reconfigured to match at best the client physical monitor configuration
|
||||
on initialization, by enabling or disabling extra monitors as
|
||||
necessary. This is currently implemented by the Spice backend only.
|
||||
If supported, the remote display will be reconfigured to match at best the
|
||||
client physical monitor configuration on initialization, by enabling or
|
||||
disabling extra monitors as necessary. This is currently implemented by the
|
||||
Spice backend only.
|
||||
|
||||
=item -t TITLE, --title TITLE
|
||||
|
||||
|
||||
@ -545,10 +545,8 @@ spice_ctrl_notified(SpiceCtrlController *ctrl,
|
||||
virt_viewer_app_set_title(app, g_value_get_string(&value));
|
||||
} else if (g_str_equal(pspec->name, "display-flags")) {
|
||||
guint flags = g_value_get_uint(&value);
|
||||
gboolean fullscreen = !!(flags & CONTROLLER_SET_FULL_SCREEN);
|
||||
gboolean auto_res = !!(flags & CONTROLLER_AUTO_DISPLAY_RES);
|
||||
gboolean fullscreen = !!(flags & (CONTROLLER_SET_FULL_SCREEN | CONTROLLER_AUTO_DISPLAY_RES));
|
||||
g_object_set(G_OBJECT(self), "fullscreen", fullscreen, NULL);
|
||||
g_object_set(G_OBJECT(self), "fullscreen-auto-conf", auto_res, NULL);
|
||||
} else if (g_str_equal(pspec->name, "menu")) {
|
||||
spice_ctrl_menu_updated(self);
|
||||
} else if (g_str_equal(pspec->name, "hotkeys")) {
|
||||
|
||||
@ -116,7 +116,6 @@ struct _VirtViewerAppPrivate {
|
||||
gboolean authretry;
|
||||
gboolean started;
|
||||
gboolean fullscreen;
|
||||
gboolean fullscreen_auto_conf;
|
||||
gboolean attach;
|
||||
gboolean quitting;
|
||||
gboolean kiosk;
|
||||
@ -166,7 +165,6 @@ enum {
|
||||
PROP_TITLE,
|
||||
PROP_ENABLE_ACCEL,
|
||||
PROP_HAS_FOCUS,
|
||||
PROP_FULLSCREEN_AUTO_CONF,
|
||||
PROP_KIOSK,
|
||||
PROP_QUIT_ON_DISCONNECT,
|
||||
};
|
||||
@ -347,8 +345,6 @@ virt_viewer_app_window_set_visible(VirtViewerApp *self,
|
||||
g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), FALSE);
|
||||
g_return_val_if_fail(VIRT_VIEWER_IS_WINDOW(window), FALSE);
|
||||
|
||||
self->priv->fullscreen_auto_conf = FALSE;
|
||||
|
||||
if (visible) {
|
||||
virt_viewer_window_show(window);
|
||||
return TRUE;
|
||||
@ -706,7 +702,7 @@ display_show_hint(VirtViewerDisplay *display,
|
||||
"show-hint", &hint,
|
||||
NULL);
|
||||
|
||||
if (self->priv->fullscreen_auto_conf &&
|
||||
if (self->priv->fullscreen &&
|
||||
nth >= gdk_screen_get_n_monitors(gdk_screen_get_default())) {
|
||||
virt_viewer_window_hide(win);
|
||||
} else if (hint & VIRT_VIEWER_DISPLAY_SHOW_HINT_DISABLED) {
|
||||
@ -1345,10 +1341,6 @@ virt_viewer_app_get_property (GObject *object, guint property_id,
|
||||
g_value_set_boolean(value, priv->focused > 0);
|
||||
break;
|
||||
|
||||
case PROP_FULLSCREEN_AUTO_CONF:
|
||||
g_value_set_boolean(value, virt_viewer_app_get_fullscreen_auto_conf(self));
|
||||
break;
|
||||
|
||||
case PROP_KIOSK:
|
||||
g_value_set_boolean(value, priv->kiosk);
|
||||
break;
|
||||
@ -1398,10 +1390,6 @@ virt_viewer_app_set_property (GObject *object, guint property_id,
|
||||
priv->enable_accel = g_value_get_boolean(value);
|
||||
break;
|
||||
|
||||
case PROP_FULLSCREEN_AUTO_CONF:
|
||||
priv->fullscreen_auto_conf = g_value_get_boolean(value);
|
||||
break;
|
||||
|
||||
case PROP_KIOSK:
|
||||
virt_viewer_app_set_kiosk(self, g_value_get_boolean(value));
|
||||
break;
|
||||
@ -1476,7 +1464,6 @@ static gchar *opt_hotkeys = NULL;
|
||||
static gboolean opt_verbose = FALSE;
|
||||
static gboolean opt_debug = FALSE;
|
||||
static gboolean opt_fullscreen = FALSE;
|
||||
static gboolean opt_fullscreen_auto_conf = FALSE;
|
||||
static gboolean opt_kiosk = FALSE;
|
||||
static gboolean opt_kiosk_quit = FALSE;
|
||||
|
||||
@ -1507,7 +1494,6 @@ virt_viewer_app_init (VirtViewerApp *self)
|
||||
}
|
||||
|
||||
self->priv->verbose = opt_verbose;
|
||||
self->priv->fullscreen_auto_conf = opt_fullscreen_auto_conf;
|
||||
self->priv->quit_on_disconnect = opt_kiosk ? opt_kiosk_quit : TRUE;
|
||||
}
|
||||
|
||||
@ -1659,15 +1645,6 @@ virt_viewer_app_class_init (VirtViewerAppClass *klass)
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
|
||||
g_object_class_install_property(object_class,
|
||||
PROP_FULLSCREEN_AUTO_CONF,
|
||||
g_param_spec_boolean("fullscreen-auto-conf",
|
||||
"auto conf",
|
||||
"Automatic display configuration in full screen",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
|
||||
g_object_class_install_property(object_class,
|
||||
PROP_TITLE,
|
||||
g_param_spec_string("title",
|
||||
@ -1902,14 +1879,6 @@ virt_viewer_app_get_fullscreen(VirtViewerApp *self)
|
||||
return self->priv->fullscreen;
|
||||
}
|
||||
|
||||
gboolean
|
||||
virt_viewer_app_get_fullscreen_auto_conf(VirtViewerApp *self)
|
||||
{
|
||||
g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), FALSE);
|
||||
|
||||
return self->priv->fullscreen_auto_conf;
|
||||
}
|
||||
|
||||
static void
|
||||
virt_viewer_app_set_fullscreen(VirtViewerApp *self, gboolean fullscreen)
|
||||
{
|
||||
@ -2173,25 +2142,6 @@ virt_viewer_app_get_windows(VirtViewerApp *self)
|
||||
return self->priv->windows;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
option_fullscreen(G_GNUC_UNUSED const gchar *option_name,
|
||||
const gchar *value,
|
||||
G_GNUC_UNUSED gpointer data, GError **error)
|
||||
{
|
||||
opt_fullscreen = TRUE;
|
||||
|
||||
if (value == NULL)
|
||||
return TRUE;
|
||||
|
||||
if (g_str_equal(value, "auto-conf")) {
|
||||
opt_fullscreen_auto_conf = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
g_set_error(error, G_OPTION_ERROR, G_OPTION_ERROR_FAILED, _("Invalid full-screen argument: %s"), value);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
option_kiosk_quit(G_GNUC_UNUSED const gchar *option_name,
|
||||
const gchar *value,
|
||||
@ -2216,8 +2166,8 @@ virt_viewer_app_get_options(void)
|
||||
static const GOptionEntry options [] = {
|
||||
{ "zoom", 'z', 0, G_OPTION_ARG_INT, &opt_zoom,
|
||||
N_("Zoom level of window, in percentage"), "ZOOM" },
|
||||
{ "full-screen", 'f', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_CALLBACK, option_fullscreen,
|
||||
N_("Open in full screen mode (auto-conf adjusts guest resolution to fit the client's)"), N_("<auto-conf>") },
|
||||
{ "full-screen", 'f', 0, G_OPTION_ARG_NONE, &opt_fullscreen,
|
||||
N_("Open in full screen mode (adjusts guest resolution to fit the client)"), NULL },
|
||||
{ "hotkeys", 'H', 0, G_OPTION_ARG_STRING, &opt_hotkeys,
|
||||
N_("Customise hotkeys"), NULL },
|
||||
{ "kiosk", 'k', 0, G_OPTION_ARG_NONE, &opt_kiosk,
|
||||
|
||||
@ -288,7 +288,7 @@ fullscreen_changed(VirtViewerDisplaySpice *self,
|
||||
{
|
||||
if (virt_viewer_display_get_fullscreen(VIRT_VIEWER_DISPLAY(self))) {
|
||||
gboolean auto_conf;
|
||||
g_object_get(app, "fullscreen-auto-conf", &auto_conf, NULL);
|
||||
g_object_get(app, "fullscreen", &auto_conf, NULL);
|
||||
if (auto_conf)
|
||||
self->priv->auto_resize = AUTO_RESIZE_NEVER;
|
||||
else
|
||||
|
||||
@ -716,18 +716,12 @@ virt_viewer_session_spice_fullscreen_auto_conf(VirtViewerSessionSpice *self)
|
||||
SpiceMainChannel* cmain = virt_viewer_session_spice_get_main_channel(self);
|
||||
VirtViewerApp *app = NULL;
|
||||
GdkRectangle dest;
|
||||
gboolean auto_conf, agent_connected;
|
||||
gboolean agent_connected;
|
||||
gint i;
|
||||
|
||||
app = virt_viewer_session_get_app(VIRT_VIEWER_SESSION(self));
|
||||
g_return_val_if_fail(VIRT_VIEWER_IS_APP(app), TRUE);
|
||||
|
||||
DEBUG_LOG("Checking full screen auto-conf");
|
||||
g_object_get(app, "fullscreen-auto-conf", &auto_conf, NULL);
|
||||
if (!auto_conf) {
|
||||
DEBUG_LOG("auto-conf disabled");
|
||||
return FALSE;
|
||||
}
|
||||
if (!virt_viewer_app_get_fullscreen(app)) {
|
||||
DEBUG_LOG("app is not in full screen");
|
||||
return FALSE;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user