X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=shell%2Fev-window.c;h=d8ab6e18fc12ea5db9c4a5c09cf3577d8e08369d;hb=3ef022d148c7ddb762bb7ec483ef218d907bf143;hp=95908d4db382054b58ed703540250abd5b963931;hpb=d3f9bc975c0b9219b1f6659570e0693a2cfd84e9;p=evince.git diff --git a/shell/ev-window.c b/shell/ev-window.c index 95908d4d..d8ab6e18 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -51,6 +51,7 @@ #include "ephy-zoom.h" #include "ev-application.h" +#include "ev-dualscreen.h" #include "ev-document-factory.h" #include "ev-document-find.h" #include "ev-document-fonts.h" @@ -309,9 +310,9 @@ static void ev_window_stop_fullscreen (EvWindow *windo 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, - gboolean unfullscreen_window);*/ +static void ev_window_run_presentation_wrapper (EvWindow *window); +static void ev_window_stop_presentation_wrapper (EvWindow *window, + gboolean unfullscreen_window); static void ev_window_cmd_view_presentation (GtkAction *action, EvWindow *window); static void ev_view_popup_cmd_open_link (GtkAction *action, @@ -1026,7 +1027,7 @@ static void update_document_mode (EvWindow *window, EvDocumentMode mode) { if (mode == EV_DOCUMENT_MODE_PRESENTATION) { - ev_window_run_presentation (window); + ev_window_run_presentation_wrapper (window); } else if (mode == EV_DOCUMENT_MODE_FULL_SCREEN) { ev_window_run_fullscreen (window); @@ -1317,7 +1318,7 @@ setup_view_from_metadata (EvWindow *window) /* Presentation */ if (ev_metadata_get_boolean (window->priv->metadata, "presentation", &presentation)) { if (presentation) { - ev_window_run_presentation (window); + ev_window_run_presentation_wrapper (window); } } } @@ -1483,7 +1484,7 @@ ev_window_set_document (EvWindow *ev_window, EvDocument *document) /* Update the model with the current presentation page */ ev_document_model_set_page (ev_window->priv->model, current_page); - ev_window_run_presentation (ev_window); + ev_window_run_presentation_wrapper (ev_window); } if (ev_window->priv->setup_document_idle > 0) @@ -1620,7 +1621,7 @@ ev_window_load_job_cb (EvJob *job, ev_window_run_fullscreen (ev_window); break; case EV_WINDOW_MODE_PRESENTATION: - ev_window_run_presentation (ev_window); + ev_window_run_presentation_wrapper (ev_window); break; default: break; @@ -2157,7 +2158,7 @@ ev_window_open_document (EvWindow *ev_window, ev_window_run_fullscreen (ev_window); break; case EV_WINDOW_MODE_PRESENTATION: - ev_window_run_presentation (ev_window); + ev_window_run_presentation_wrapper (ev_window); break; default: break; @@ -3999,6 +4000,25 @@ ev_window_view_presentation_focus_out (EvWindow *window) return FALSE; } +static void +ev_window_run_presentation_wrapper (EvWindow *window) +{ + if ( get_num_monitors(GTK_WINDOW(window)) > 1) { + EvWindow *presentation_window = window; + EvDSCWindow *control = ev_dscwindow_get_control(); + + ev_dscwindow_set_presentation (control, presentation_window, + presentation_window->priv->document); + gtk_window_present (GTK_WINDOW (control)); + } else + ev_window_stop_presentation (window, TRUE); + +} +static void +ev_window_stop_presentation_wrapper(EvWindow *window, gboolean unfullscreen_window) +{ +} + void ev_window_run_presentation (EvWindow *window) { @@ -4095,7 +4115,7 @@ ev_window_cmd_view_presentation (GtkAction *action, EvWindow *window) presentation = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)); if (presentation) { - ev_window_run_presentation (window); + ev_window_run_presentation_wrapper (window); } } @@ -4573,7 +4593,7 @@ ev_window_cmd_leave_fullscreen (GtkAction *action, EvWindow *window) static void ev_window_cmd_start_presentation (GtkAction *action, EvWindow *window) { - ev_window_run_presentation (window); + ev_window_run_presentation_wrapper (window); } static void @@ -6764,7 +6784,7 @@ ev_window_media_player_key_pressed (EvWindow *window, * often seen keys */ if (strcmp (key, "Play") == 0) { - ev_window_run_presentation (window); + ev_window_run_presentation_wrapper (window); } else if (strcmp (key, "Previous") == 0) { if (EV_WINDOW_IS_PRESENTATION (window)) ev_view_presentation_previous_page (EV_VIEW_PRESENTATION (window->priv->presentation_view));