FLTK logo

[master] 82fa5ea - Fix Fl_Wayland_Window_Driver::decoration_sizes().

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] 82fa5ea - Fix Fl_Wayland_Window_Driver::decoration_sizes(). "ManoloFLTK" Aug 15, 2022  
 
commit 82fa5ea19c004c05723919daa96e3c2779af2aad
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Mon Aug 15 18:40:11 2022 +0200
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Mon Aug 15 18:40:11 2022 +0200

    Fix Fl_Wayland_Window_Driver::decoration_sizes().

 src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
index 3c4cb76..6a74dae 100644
--- src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
+++ src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
@@ -577,12 +577,14 @@ void Fl_Wayland_Window_Driver::iconize() {
 
 
 void Fl_Wayland_Window_Driver::decoration_sizes(int *top, int *left,  int *right, int *bottom) {
-  // Ensure border is on screen; these values are generic enough
-  // to work with many window managers, and are based on KDE defaults.
-  *top = 20;
-  *left = 4;
-  *right = 4;
-  *bottom = 8;
+  struct wld_window *xid = (struct wld_window*)fl_xid(pWindow);
+  if (xid && xid->kind == DECORATED) {
+    libdecor_frame_translate_coordinate(xid->frame, 0, 0, left, top);
+    *right = *left;
+    *bottom = 0;
+  } else {
+    Fl_Window_Driver::decoration_sizes(top, left, right, bottom);
+  }
 }
 
 void Fl_Wayland_Window_Driver::show_with_args_begin() {
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.