From 939d08af196f1e3d443046d62098b648a8a71ef4 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Wed, 6 Jan 2021 12:23:42 +0100 Subject: [PATCH] Fix of #4532 - "Send G-Code to printer host" dialog box blanks out text on Linux --- src/slic3r/GUI/PrintHostDialogs.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/slic3r/GUI/PrintHostDialogs.cpp b/src/slic3r/GUI/PrintHostDialogs.cpp index a9343767f..75f6d265d 100644 --- a/src/slic3r/GUI/PrintHostDialogs.cpp +++ b/src/slic3r/GUI/PrintHostDialogs.cpp @@ -80,6 +80,17 @@ PrintHostSendDialog::PrintHostSendDialog(const fs::path &path, bool can_start_pr Fit(); CenterOnParent(); +#ifdef __linux__ + // On Linux with GTK2 when text control lose the focus then selection (colored background) disappears but text color stay white + // and as a result the text is invisible with light mode + // see https://github.com/prusa3d/PrusaSlicer/issues/4532 + // Workaround: Unselect text selection explicitly on kill focus + txt_filename->Bind(wxEVT_KILL_FOCUS, [this](wxEvent& e) { + e.Skip(); + txt_filename->SetInsertionPoint(txt_filename->GetLastPosition()); + }, txt_filename->GetId()); +#endif /* __linux__ */ + Bind(wxEVT_SHOW, [=](const wxShowEvent &) { // Another similar case where the function only works with EVT_SHOW + CallAfter, // this time on Mac.