static void ev_window_add_recent (EvWindow *window,
const char *filename);
static void ev_window_run_fullscreen (EvWindow *window);
-static void ev_window_stop_fullscreen (EvWindow *window);
+static void ev_window_stop_fullscreen (EvWindow *window,
+ gboolean unfullscreen_window);
static void ev_window_cmd_view_fullscreen (GtkAction *action,
EvWindow *window);
static void ev_window_run_presentation (EvWindow *window);
-static void ev_window_stop_presentation (EvWindow *window);
+static void ev_window_stop_presentation (EvWindow *window,
+ gboolean unfullscreen_window);
static void ev_window_cmd_view_presentation (GtkAction *action,
EvWindow *window);
static void ev_window_run_preview (EvWindow *window);
{
gboolean continuous;
- ev_window_stop_presentation (ev_window);
+ ev_window_stop_presentation (ev_window, TRUE);
continuous = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
g_object_set (G_OBJECT (ev_window->priv->view),
"continuous", continuous,
{
gboolean dual_page;
- ev_window_stop_presentation (ev_window);
+ ev_window_stop_presentation (ev_window, TRUE);
dual_page = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
g_object_set (G_OBJECT (ev_window->priv->view),
"dual-page", dual_page,
static void
ev_window_cmd_view_best_fit (GtkAction *action, EvWindow *ev_window)
{
- ev_window_stop_presentation (ev_window);
+ ev_window_stop_presentation (ev_window, TRUE);
if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action))) {
ev_view_set_sizing_mode (EV_VIEW (ev_window->priv->view), EV_SIZING_BEST_FIT);
static void
ev_window_cmd_view_page_width (GtkAction *action, EvWindow *ev_window)
{
- ev_window_stop_presentation (ev_window);
+ ev_window_stop_presentation (ev_window, TRUE);
if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action))) {
ev_view_set_sizing_mode (EV_VIEW (ev_window->priv->view), EV_SIZING_FIT_WIDTH);
static void
ev_window_run_fullscreen (EvWindow *window)
{
+ EvView *view = EV_VIEW (window->priv->view);
+ gboolean fullscreen_window = TRUE;
+
+ if (ev_view_get_fullscreen (view))
+ return;
+
if (!window->priv->fullscreen_toolbar) {
window->priv->fullscreen_toolbar =
gtk_ui_manager_get_widget (window->priv->ui_manager,
window->priv->fullscreen_toolbar, 1);
}
+ if (ev_view_get_presentation (view)) {
+ ev_window_stop_presentation (window, FALSE);
+ fullscreen_window = FALSE;
+ }
+
g_object_set (G_OBJECT (window->priv->scrolled_window),
"shadow-type", GTK_SHADOW_NONE,
NULL);
- ev_view_set_fullscreen (EV_VIEW (window->priv->view), TRUE);
+ ev_view_set_fullscreen (view, TRUE);
ev_window_update_fullscreen_action (window);
/* If the user doesn't have the main toolbar he/she won't probably want
update_chrome_flag (window, EV_CHROME_FULLSCREEN_TOOLBAR,
(window->priv->chrome & EV_CHROME_TOOLBAR) != 0);
update_chrome_visibility (window);
-
- gtk_window_fullscreen (GTK_WINDOW (window));
+
+ if (fullscreen_window)
+ gtk_window_fullscreen (GTK_WINDOW (window));
gtk_widget_grab_focus (window->priv->view);
if (!ev_window_is_empty (window))
}
static void
-ev_window_stop_fullscreen (EvWindow *window)
+ev_window_stop_fullscreen (EvWindow *window,
+ gboolean unfullscreen_window)
{
EvView *view = EV_VIEW (window->priv->view);
- if (!ev_view_get_fullscreen (EV_VIEW (view)))
+ if (!ev_view_get_fullscreen (view))
return;
g_object_set (G_OBJECT (window->priv->scrolled_window),
ev_window_update_fullscreen_action (window);
update_chrome_flag (window, EV_CHROME_FULLSCREEN_TOOLBAR, FALSE);
update_chrome_visibility (window);
- gtk_window_unfullscreen (GTK_WINDOW (window));
+ if (unfullscreen_window)
+ gtk_window_unfullscreen (GTK_WINDOW (window));
if (!ev_window_is_empty (window))
ev_metadata_manager_set_boolean (window->priv->uri, "fullscreen", FALSE);
{
gboolean fullscreen;
- g_return_if_fail (EV_IS_WINDOW (window));
- ev_window_stop_presentation (window);
-
fullscreen = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
if (fullscreen) {
ev_window_run_fullscreen (window);
} else {
- ev_window_stop_fullscreen (window);
+ ev_window_stop_fullscreen (window, TRUE);
}
}
static void
ev_window_run_presentation (EvWindow *window)
{
+ EvView *view = EV_VIEW (window->priv->view);
+ gboolean fullscreen_window = TRUE;
+
+ if (ev_view_get_presentation (view))
+ return;
+
+ if (ev_view_get_fullscreen (view)) {
+ ev_window_stop_fullscreen (window, FALSE);
+ fullscreen_window = FALSE;
+ }
+
g_object_set (G_OBJECT (window->priv->scrolled_window),
"shadow-type", GTK_SHADOW_NONE,
NULL);
- ev_view_set_presentation (EV_VIEW (window->priv->view), TRUE);
+ ev_view_set_presentation (view, TRUE);
ev_window_update_presentation_action (window);
update_chrome_visibility (window);
gtk_widget_grab_focus (window->priv->view);
- gtk_window_fullscreen (GTK_WINDOW (window));
+ if (fullscreen_window)
+ gtk_window_fullscreen (GTK_WINDOW (window));
g_signal_connect (window->priv->view,
"motion-notify-event",
}
static void
-ev_window_stop_presentation (EvWindow *window)
+ev_window_stop_presentation (EvWindow *window,
+ gboolean unfullscreen_window)
{
- if (!ev_view_get_presentation (EV_VIEW (window->priv->view)))
+ EvView *view = EV_VIEW (window->priv->view);
+
+ if (!ev_view_get_presentation (view))
return;
g_object_set (G_OBJECT (window->priv->scrolled_window),
ev_view_set_presentation (EV_VIEW (window->priv->view), FALSE);
ev_window_update_presentation_action (window);
update_chrome_visibility (window);
- gtk_window_unfullscreen (GTK_WINDOW (window));
+ if (unfullscreen_window)
+ gtk_window_unfullscreen (GTK_WINDOW (window));
g_signal_handlers_disconnect_by_func (window->priv->view,
(gpointer) presentation_motion_notify_cb,
{
gboolean presentation;
- g_return_if_fail (EV_IS_WINDOW (window));
- ev_window_stop_fullscreen (window);
-
presentation = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
if (presentation) {
ev_window_run_presentation (window);
} else {
- ev_window_stop_presentation (window);
+ ev_window_stop_presentation (window, TRUE);
}
}
static void
ev_window_cmd_leave_fullscreen (GtkAction *action, EvWindow *window)
{
- ev_window_stop_fullscreen (window);
+ ev_window_stop_fullscreen (window, TRUE);
}
static void
ev_window_cmd_start_presentation (GtkAction *action, EvWindow *window)
{
- ev_window_stop_fullscreen (window);
ev_window_run_presentation (window);
}
NULL);
if (fullscreen) {
- ev_window_stop_fullscreen (window);
+ ev_window_stop_fullscreen (window, TRUE);
} else if (presentation) {
- ev_window_stop_presentation (window);
+ ev_window_stop_presentation (window, TRUE);
gtk_widget_grab_focus (window->priv->view);
} else {
gtk_widget_grab_focus (window->priv->view);