Giter Site home page Giter Site logo

Multihead fullscreen broken on macOS about fltk HOT 3 CLOSED

fltk avatar fltk commented on July 25, 2024
Multihead fullscreen broken on macOS

from fltk.

Comments (3)

CendioOssman avatar CendioOssman commented on July 25, 2024

Suggested fix:

diff -up fltk-1.3.5/src/Fl_cocoa.mm.multihead fltk-1.3.5/src/Fl_cocoa.mm
--- fltk-1.3.5/src/Fl_cocoa.mm.multihead	2020-01-21 13:46:18.640982691 +0100
+++ fltk-1.3.5/src/Fl_cocoa.mm	2020-01-21 13:49:00.267671569 +0100
@@ -3100,8 +3100,31 @@ void Fl_Window::fullscreen_x() {
     [i->xid setStyleMask:NSBorderlessWindowMask]; //10.6
 #endif
     [i->xid setLevel:NSStatusWindowLevel];
-    int X,Y,W,H;
-    Fl::screen_xywh(X, Y, W, H, x(), y(), w(), h());
+
+    int top, bottom, left, right;
+    int sx, sy, sw, sh, X, Y, W, H;
+
+    top = fullscreen_screen_top;
+    bottom = fullscreen_screen_bottom;
+    left = fullscreen_screen_left;
+    right = fullscreen_screen_right;
+
+    if ((top < 0) || (bottom < 0) || (left < 0) || (right < 0)) {
+      top = Fl::screen_num(x(), y(), w(), h());
+      bottom = top;
+      left = top;
+      right = top;
+    }
+
+    Fl::screen_xywh(sx, sy, sw, sh, top);
+    Y = sy;
+    Fl::screen_xywh(sx, sy, sw, sh, bottom);
+    H = sy + sh - Y;
+    Fl::screen_xywh(sx, sy, sw, sh, left);
+    X = sx;
+    Fl::screen_xywh(sx, sy, sw, sh, right);
+    W = sx + sw - X;
+
     resize(X, Y, W, H);
   }
   Fl::handle(FL_FULLSCREEN, this);

This is for 1.3.5 but the principle should apply to master as well.

from fltk.

ManoloFLTK avatar ManoloFLTK commented on July 25, 2024

Thanks for the patch.
Committed to the 1.4 branch. [Branch 1.3 is no longer updated].
Please, close issue if you confirm it's OK.

from fltk.

CendioOssman avatar CendioOssman commented on July 25, 2024

I'm afraid I don't have a test setup for 1.4. But your commit looks fine, so let's just close this issue. :)

from fltk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.