Skip to content
This repository
Browse code

[osx] - log the window name if a window completly obscures XBMC and l…

…eads to framelimiting (so we can identify / add exceptional apps easily)
  • Loading branch information...
commit 923014c09626c82db6984c801e5a273c59b5f2d5 1 parent 0d08d5c
Memphiz authored January 10, 2013

Showing 1 changed file with 11 additions and 0 deletions. Show diff stats Hide diff stats

  1. 11  xbmc/windowing/osx/WinSystemOSX.mm
11  xbmc/windowing/osx/WinSystemOSX.mm
@@ -1299,6 +1299,7 @@ static void DisplayReconfigured(CGDirectDisplayID display,
1299 1299
   // default to false before we start parsing though the windows.
1300 1300
   // if we are are obscured by any windows, then set true.
1301 1301
   m_obscured = false;
  1302
+  static bool obscureLogged = false;
1302 1303
 
1303 1304
   CGWindowListOption opts;
1304 1305
   opts = kCGWindowListOptionOnScreenAboveWindow | kCGWindowListExcludeDesktopElements;
@@ -1355,6 +1356,12 @@ static void DisplayReconfigured(CGDirectDisplayID display,
1355 1356
       if (CGRectContainsRect(windowBounds, bounds))
1356 1357
       {
1357 1358
         // if the windowBounds completely encloses our bounds, we are obscured.
  1359
+        if (!obscureLogged)
  1360
+        {
  1361
+          const char* cstr = CFStringGetCStringPtr(ownerName, CFStringGetSystemEncoding());
  1362
+          CLog::Log(LOGDEBUG, "WinSystemOSX: Fullscreen window %s obscures XBMC!", cstr);
  1363
+          obscureLogged = true;
  1364
+        }
1358 1365
         m_obscured = true;
1359 1366
         break;
1360 1367
       }
@@ -1372,6 +1379,10 @@ static void DisplayReconfigured(CGDirectDisplayID display,
1372 1379
 
1373 1380
   if (!m_obscured)
1374 1381
   {
  1382
+    // if we are here we are not obscured by any fullscreen window - reset flag
  1383
+    // for allowing the logmessage above to show again if this changes.
  1384
+    if (obscureLogged)
  1385
+      obscureLogged = false;
1375 1386
     std::vector<CRect> rects = ourBounds.SubtractRects(partialOverlaps);
1376 1387
     // they got us covered
1377 1388
     if (rects.size() == 0)

2 notes on commit 923014c

davilla
Collaborator

hahahaha

Memphiz
Owner

yeah - this is an os string - we have to ask for the right encoding :D

Please sign in to comment.
Something went wrong with that request. Please try again.