FLTK logo

[fltk/fltk] If app appears on non-active screen, window resizes (#259)

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.issues  ]
 
Previous Message ]New Message | Reply ]Next Message ]

[fltk/fltk] If app appears on non-active screen, window resizes (#259) Webb Hinton Jul 18, 2021  
 

Moved this issue from fltk-rs/fltk-rs#784 to here, as it seems to be purely related to C FLTK.

When I launch my FLTK app, sometimes the window automatically resizes. This behavior only occurs when the cursor is not on the same screen as the app when the app window appears. That is, the app launches on the "non-active" window.

This resizing can also sometimes cause widgets to resize strangely.

I'm using the same monitor setup as when we were working through the gidplus issue. (launching the app on the active screen in VSCode, then having the app appear on the "non active" monitor). fltk-rs/fltk-rs#740. Monitor 0 is 1920x1080 and monitor 1 is 4k.

Os is Win10x64

#include <FL/Fl.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Window.H>

int main() {
    auto win = new Fl_Window(500, 500, "Counter");
    auto but1 = new Fl_Button(100, 100, 100, 100, "Dummy");
    auto but2 = new Fl_Box(200, 100, 100, 100, "Dummy");
    but1->tooltip("Tooltip..");
    // auto but3 = new FL_Button
    win->end();
    win->show();
    Fl::lock();
    return Fl::run(); 
}

CMakeLists.txt

cmake_minimum_required(VERSION 3.15)
project(monitors)

include(FetchContent)

set(FLTK_BUILD_TEST OFF CACHE BOOL " " FORCE)
set(OPTION_USE_GDIPLUS ON CACHE BOOL " " FORCE)

FetchContent_Declare(FLTK
    GIT_REPOSITORY https://github.com/fltk/fltk
    GIT_SHALLOW TRUE
)
FetchContent_MakeAvailable(FLTK)

add_executable(main main.cpp)
target_link_libraries(main PRIVATE fltk gdiplus)
target_include_directories(main PRIVATE ${fltk_SOURCE_DIR} ${fltk_BINARY_DIR})
target_link_libraries(main PRIVATE fltk)

build.bat

cmake -S. -Bbin -DCMAKE_BUILD_TYPE=Release && cmake --build bin --config Release

resize_mon_issue


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]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'.