|
|
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
— 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 ] | |
|
| |