[longomatch] Fix full screen switching



commit 893cde07433ded9b46800c849b8557ded4a07f65
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Mon Sep 1 20:03:02 2014 +0200

    Fix full screen switching

 LongoMatch.Core/Interfaces/GUI/IAnalysisWindow.cs |    2 --
 LongoMatch.Core/Interfaces/GUI/IGUIToolkit.cs     |    1 +
 LongoMatch.GUI/Gui/Component/AnalysisComponent.cs |    6 ------
 LongoMatch.GUI/Gui/GUIToolkit.cs                  |   11 +++++++++++
 LongoMatch.GUI/Gui/MainWindow.cs                  |    3 +++
 LongoMatch.Services/Services/EventsManager.cs     |    7 +++++++
 6 files changed, 22 insertions(+), 8 deletions(-)
---
diff --git a/LongoMatch.Core/Interfaces/GUI/IAnalysisWindow.cs 
b/LongoMatch.Core/Interfaces/GUI/IAnalysisWindow.cs
index 5652e76..7e2936e 100644
--- a/LongoMatch.Core/Interfaces/GUI/IAnalysisWindow.cs
+++ b/LongoMatch.Core/Interfaces/GUI/IAnalysisWindow.cs
@@ -34,8 +34,6 @@ namespace LongoMatch.Interfaces.GUI
                void DeletePlays (List<Play> plays);
                void DetachPlayer ();
                
-               bool Fullscreen {set;}
-               
                IPlayerBin Player{get;}
                ICapturerBin Capturer{get;}
        }
diff --git a/LongoMatch.Core/Interfaces/GUI/IGUIToolkit.cs b/LongoMatch.Core/Interfaces/GUI/IGUIToolkit.cs
index c1045ac..fd494ee 100644
--- a/LongoMatch.Core/Interfaces/GUI/IGUIToolkit.cs
+++ b/LongoMatch.Core/Interfaces/GUI/IGUIToolkit.cs
@@ -34,6 +34,7 @@ namespace LongoMatch.Interfaces.GUI
                IMainController MainController {get;}
                IRenderingStateBar RenderingStateBar {get;}
                Version Version {get;}
+               bool FullScreen {set;}
        
                void Quit ();
                
diff --git a/LongoMatch.GUI/Gui/Component/AnalysisComponent.cs 
b/LongoMatch.GUI/Gui/Component/AnalysisComponent.cs
index 66abe49..1789530 100644
--- a/LongoMatch.GUI/Gui/Component/AnalysisComponent.cs
+++ b/LongoMatch.GUI/Gui/Component/AnalysisComponent.cs
@@ -63,12 +63,6 @@ namespace LongoMatch.Gui.Component
                        }
                }
                
-               public bool Fullscreen {
-                       set {
-                               playercapturer.FullScreen = value;
-                       }
-               }
-               
                public void AddPlay(Play play) {
                        playsSelection.AddPlay(play);
                        codingwidget.AddPlay (play);
diff --git a/LongoMatch.GUI/Gui/GUIToolkit.cs b/LongoMatch.GUI/Gui/GUIToolkit.cs
index 4bcefd2..1aaed9c 100644
--- a/LongoMatch.GUI/Gui/GUIToolkit.cs
+++ b/LongoMatch.GUI/Gui/GUIToolkit.cs
@@ -64,6 +64,17 @@ namespace LongoMatch.Gui
                                return mainWindow.RenderingStateBar;
                        }
                }
+
+               public bool FullScreen {
+                       set {
+                               if (mainWindow != null) {
+                                       if (value)
+                                               mainWindow.GdkWindow.Fullscreen ();
+                                       else 
+                                               mainWindow.GdkWindow.Unfullscreen ();
+                               }
+                       }
+               }
                
                public Version Version {
                        get;
diff --git a/LongoMatch.GUI/Gui/MainWindow.cs b/LongoMatch.GUI/Gui/MainWindow.cs
index 08766dd..d6c6d9b 100644
--- a/LongoMatch.GUI/Gui/MainWindow.cs
+++ b/LongoMatch.GUI/Gui/MainWindow.cs
@@ -192,6 +192,9 @@ namespace LongoMatch.Gui
                        ImportProjectAction.Activated += (sender, e) => {
                                Config.EventsBroker.EmitImportProject ();
                        };
+                       FullScreenAction.Activated += (object sender, EventArgs e) => {
+                               Config.EventsBroker.EmitShowFullScreen (FullScreenAction.Active);
+                       };
                }
                
                void RemovePanel () {
diff --git a/LongoMatch.Services/Services/EventsManager.cs b/LongoMatch.Services/Services/EventsManager.cs
index 06afedb..c6ae55b 100644
--- a/LongoMatch.Services/Services/EventsManager.cs
+++ b/LongoMatch.Services/Services/EventsManager.cs
@@ -95,6 +95,13 @@ namespace LongoMatch.Services
 
                        Config.EventsBroker.DrawFrame += HandleDrawFrame;
                        Config.EventsBroker.Detach += HandleDetach;
+                       
+                       Config.EventsBroker.ShowFullScreenEvent += HandleShowFullScreenEvent;
+               }
+
+               void HandleShowFullScreenEvent (bool fullscreen)
+               {
+                       guiToolkit.FullScreen = fullscreen;
                }
 
                void HandlePlayLoaded (Play play)


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