# kill g_Windowing, another nasty global #13047

Merged
merged 6 commits into from Nov 24, 2017

## Conversation

Member

### FernetMenta commented Nov 13, 2017

 another chapter in the endless story of kill ugly globals @pkerling this will eventually enable running X11 and Wayland from the same binary.
added the label Nov 13, 2017
Member

### pkerling commented Nov 13, 2017

 Nice, very much looking forward to this!
reviewed
 @@ -24,7 +24,7 @@ #include "cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlayImage.h" #include "cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlaySpu.h" #include "cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlaySSA.h" #include "windowing/WindowingFactory.h" #include "windowing/WinSystem.h"

### This comment has been minimized.

reviewed
 void CServiceManager::SetWinSystem(std::unique_ptr &winSystem) { m_winSystem.reset();

Member

### garbear commented Nov 13, 2017

 awesome. thanks for making the RetroPlayer changes
reviewed
 @@ -768,7 +775,9 @@ bool CApplication::InitWindow(RESOLUTION res) bool CApplication::DestroyWindow() { return g_Windowing.DestroyWindow(); return CServiceBroker::GetWinSystem().DestroyWindow(); std::unique_ptr winSystem;

### This comment has been minimized.

added this to the L 18.0-alpha1 milestone Nov 14, 2017
Member Author

### FernetMenta commented Nov 17, 2017

 @afedchin would be great if you could adapt the Windows ports to this change
Member

### afedchin commented Nov 17, 2017

 It will be not easy and I haven't time on this weekend, so may be at monday.
referenced this pull request Nov 18, 2017
``` Check windowing return value before updating GraphicContext resolution ```
``` e015168 ```
Member Author

Contributor

### lrusak commented Nov 18, 2017

added the label Nov 19, 2017
Member Author

### FernetMenta commented Nov 19, 2017

 You are a silly bot that knows nothing. This pr is waiting for some contributions
Contributor

### lrusak commented Nov 20, 2017 • edited

 Which platforms are we missing here? Windows OSX iOS X11 Wayland Mir GBM Android Amlogic RPi
Member Author

### FernetMenta commented Nov 20, 2017

 Windows, RPi, Android, (Mir) are missing.
Member

### pkerling commented Nov 21, 2017

 What's the stance on Mir? Is it maintained?
requested a review from popcornmix Nov 21, 2017
Member Author

### FernetMenta commented Nov 21, 2017 • edited

 What's the stance on Mir? Is it maintained?

### BrandonSchaefer commented Nov 21, 2017 • edited

 Mir now currently supports Wayland core clients So let me test if the that is good enough now. If not, we should maintain a Mir backend until Mir's Wayland support improves. For this fix though it would be pretty easy to fix up the Mir parts (I can get a diff soon-ish if testing the Wayland core bits isnt good enough yet, also yay no more g_window globa!). Also more info on Mir and its current direction: https://community.ubuntu.com/c/mir
Member

### popcornmix commented Nov 21, 2017

 @FernetMenta I have most of pi stuff fixed up. OMXImage is the trickier part: https://github.com/xbmc/xbmc/blob/master/xbmc/cores/omxplayer/OMXImage.cpp#L339 Can you suggest the desired path to get egl display/context info in the new world?
Member Author

### FernetMenta commented Nov 22, 2017

 @popcornmix the fastest method is to typecast the genering interface to the specific one of your implementation. A better way is to pass required info to the instance when you create it.
added the label Nov 22, 2017
force-pushed the FernetMenta:windowing branch 2 times, most recently from `e92df47` to `f977f8d` Nov 22, 2017
removed the label Nov 22, 2017
reviewed
 @@ -231,7 +234,9 @@ void CMouseStat::SetActive(bool active /*=true*/) // 1. The mouse is active (it has been moved) AND // 2. The XBMC mouse is disabled in settings AND // 3. XBMC is not in fullscreen. g_Windowing.ShowOSMouse(m_mouseState.active && !IsEnabled() && !g_Windowing.IsFullScreen()); CWinSystemBase &winSystem = CServiceBroker::GetWinSystem(); if (&winSystem)

Member Author

### FernetMenta commented Nov 22, 2017

 @afedchin C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\agile.h(19): fatal error C1189: #error: agile.h can only be used with /ZW (compiling source file C:\jenkins_slave\workspace\WIN-64\xbmc\guilib\D3DResource.cpp)
reviewed
 #endif #include "xbmc/ServiceBroker.h" #include

Member Author

Member Author

Member Author

Member Author

### FernetMenta commented Nov 23, 2017

added the label Nov 23, 2017
referenced this pull request Nov 23, 2017
Member

### garbear commented Nov 23, 2017

 @FernetMenta small improvement for you: FernetMenta#440
reviewed
 @@ -18,18 +18,17 @@ * http://www.gnu.org/copyleft/gpl.html * */ #pragma once

Member Author

### FernetMenta commented Nov 24, 2017

 @popcornmix do you plan to submit PI adaptations in the near future?
Member

### popcornmix commented Nov 24, 2017 • edited

 @FernetMenta Builds but need to work out what to do for get egl display/context popcornmix@c99c47f but I'm looking into it now.
and others added 6 commits Nov 13, 2017
``` kill g_Windowing, another nasty global ```
``` ab9f535 ```
``` windowing/gbm: update to work with new windowing method ```
``` b0c49f6 ```
``` [AML] adaption ```
``` d5324b2 ```
``` [Android] adapt changes ```
``` 87bf940 ```
``` rbp: kill g_Windowing ```
``` 46a4077 ```
``` [windows] drop global g_Windowing ```
``` 4467b4f ```
Contributor

### lrusak commented Nov 24, 2017

 Do we want to wait on Mir?
Member Author

### FernetMenta commented Nov 24, 2017

 I am not aware that we have any/many alpha testers on Mir. Hence moving forward has higher prio. Patches for Mir can be submitted at any time later.
Member Author

### FernetMenta commented Nov 24, 2017

 Linux-64 test suite error in ThreadLocal unrelated to this PR. Test runs fine on my local system.
merged commit `4b22591` into xbmc:master Nov 24, 2017
1 check failed
1 check failed
default Sorry, building this PR failed. Please check the logs for the errors.
Details
deleted the FernetMenta:windowing branch Nov 24, 2017
{"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8337063789367676, "perplexity": 22848.97131241867}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-43/segments/1570987813307.73/warc/CC-MAIN-20191022081307-20191022104807-00144.warc.gz"}