Skip to content

NEEDS WINDOWS TESTING: gui: keep background-job widgets on the GTK thread - #21949

Open
Arecsu wants to merge 1 commit into
darktable-org:masterfrom
Arecsu:continue-todo
Open

NEEDS WINDOWS TESTING: gui: keep background-job widgets on the GTK thread#21949
Arecsu wants to merge 1 commit into
darktable-org:masterfrom
Arecsu:continue-todo

Conversation

@Arecsu

@Arecsu Arecsu commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Fixes #21829

The background-jobs panel was creating GTK widgets from worker threads and only queueing their packing/showing. This made widget creation, progress updates, and teardown timing-dependent, contributing to platform-specific focus problems.

The panel now keeps worker callbacks GTK-free: they update plain state, while widget creation, updates, cancellation controls, and removal run on the GTK thread. Queued callbacks also keep job data alive and are invalidated during cleanup.

Linux GTK3 builds and cancellation/lifecycle stress tests pass. Windows testing is still required.

Related: #21843

@Arecsu

Arecsu commented Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

@lintujuh & @Thanatomanic

if you can test this one, this might finally fix the focus stealing in Windows when exporting. I don't have a Windows machine yet to test this myself

@TurboGit I've tested possible regressions under Linux, creating many batched exports, canceling, creating them, etc, and everything seems fine so far. Just mentioning in case you might want to check it for yourself, that is what should be tested

@ralfbrown ralfbrown added bugfix pull request fixing a bug scope: UI user interface and interactions labels Aug 22, 2026
@Thanatomanic

Copy link
Copy Markdown

@Arecsu I'm afraid this has not solved the focus stealing for me on Windows 10 (during export nor import), building on an updated MSYS2 environment.

Are there more diagnostics I can provide you, like which gtk libs and other versions were used to build? I could potentially try to bisect since 5.4 when this issue was not there, but that's not at all trivial.

@lintujuh

Copy link
Copy Markdown

I tested your version on Win11 and for me it worked perfectly. I started the export of few images, switched to another virtual desktop, and the focus stayed on that desktop the whole export, and also remained there when the export had finished.

@Thanatomanic

Copy link
Copy Markdown

Okay, let me try to do the same on my Windows 11 laptop. Will probably only be able to do that later this week, but maybe I'll find time.

@Thanatomanic

Copy link
Copy Markdown

Perhaps you can ask other Windows testers on Pixls.us?

@Arecsu

Arecsu commented Aug 23, 2026

Copy link
Copy Markdown
Contributor Author

@lintujuh nice! could you please check if it also does not focus steal while minimized / at the bottom of other windows in the within the same workspace desktop? This way we see if we coincide with the report from @Thanatomanic

And @Thanatomanic I think it is important to share the GTK libs and compiler used to build it. Good catch on that one. We don't have any logging paths in the code that would give us important data as far as I know.

Bisecting also won't be helpful as we know it's closely related to the event controllers or gtk4-compatible windowing system. I made an AI do some deep research on the GTK3 source code to see where and how it calls to Windows focus stealing APIs. We found a few, none of which were clearly used and triggered by the code at darktable. Ah, GTK3 and its quirks 🥲

I'll see if I could get a hold of a VM machine

@Thanatomanic

Thanatomanic commented Aug 23, 2026

Copy link
Copy Markdown

I compile with GCC 16.2 in MSYS2 on Windows 10. Here are my packages:

My packages and details.
base 2022.06-1
base-devel 2026.08-3
cmake 4.4.2-1
diffutils 3.12-1
flex 2.6.4-4
gdb 17.1-3
git 2.55.0-1
intltool 0.51.0-4
make 4.4.1-3
mingw-w64-ucrt-x86_64-SDL2 2.32.10-1
mingw-w64-ucrt-x86_64-boost 1.91.0-3
mingw-w64-ucrt-x86_64-cfitsio 1~4.7.0-1
mingw-w64-ucrt-x86_64-cmake 4.4.2-2
mingw-w64-ucrt-x86_64-drmingw 0.9.11-2
mingw-w64-ucrt-x86_64-eigen3 5.0.1-1
mingw-w64-ucrt-x86_64-exiv2 0.28.8-1
mingw-w64-ucrt-x86_64-gcc 16.2.0-3
mingw-w64-ucrt-x86_64-gettext-tools 1.0-1
mingw-w64-ucrt-x86_64-gmic 3.7.0-2
mingw-w64-ucrt-x86_64-graphicsmagick 1.3.48-1
mingw-w64-ucrt-x86_64-gsl 2.8-1
mingw-w64-ucrt-x86_64-gtk3 3.24.52-1
mingw-w64-ucrt-x86_64-gtkmm3 3.24.10-3
mingw-w64-ucrt-x86_64-icu 78.3-4
mingw-w64-ucrt-x86_64-imath 3.2.3-1
mingw-w64-ucrt-x86_64-iso-codes 4.20.1-1
mingw-w64-ucrt-x86_64-lcms2 2.19.1-1
mingw-w64-ucrt-x86_64-lensfun 0.3.4-8
mingw-w64-ucrt-x86_64-libavif 1.4.2-1
mingw-w64-ucrt-x86_64-libgphoto2 2.5.34-2
mingw-w64-ucrt-x86_64-libheif 1.23.1-3
mingw-w64-ucrt-x86_64-libiptcdata 1.0.5-1
mingw-w64-ucrt-x86_64-libjpeg-turbo 3.2.0-1
mingw-w64-ucrt-x86_64-libjxl 0.12.0-1
mingw-w64-ucrt-x86_64-libpng 1.6.58-1
mingw-w64-ucrt-x86_64-libraw 0.22.2-1
mingw-w64-ucrt-x86_64-librsvg 2.62.3-1
mingw-w64-ucrt-x86_64-libsecret 0.21.7-1
mingw-w64-ucrt-x86_64-libtiff 4.7.2-1
mingw-w64-ucrt-x86_64-libwebp 1.6.0-1
mingw-w64-ucrt-x86_64-libxml2 2.15.3-1
mingw-w64-ucrt-x86_64-libxslt 1.1.45-1
mingw-w64-ucrt-x86_64-lua 5.5.1-1
mingw-w64-ucrt-x86_64-mimalloc 3.4.4-1
mingw-w64-ucrt-x86_64-ninja 1.13.2-1
mingw-w64-ucrt-x86_64-opencolorio 2.5.2-1
mingw-w64-ucrt-x86_64-openexr 3.4.14-1
mingw-w64-ucrt-x86_64-openjpeg2 2.5.4-2
mingw-w64-ucrt-x86_64-osm-gps-map 1.2.0-6
mingw-w64-ucrt-x86_64-portmidi 1~2.0.8-1
mingw-w64-ucrt-x86_64-potrace 1.16-3
mingw-w64-ucrt-x86_64-pugixml 1.16-1
mingw-w64-ucrt-x86_64-python-jsonschema 4.26.0-2
mingw-w64-ucrt-x86_64-qt5-svg 5.15.19+kde+r5-1
mingw-w64-ucrt-x86_64-qt5-tools 5.15.19-1
mingw-w64-ucrt-x86_64-qt5-winextras 5.15.19-1
mingw-w64-ucrt-x86_64-qtwebkit 5.212.0alpha4-27
mingw-w64-ucrt-x86_64-sqlite3 3.53.4-1
mingw-w64-ucrt-x86_64-webp-pixbuf-loader 0.2.7-2
ninja 1.13.2-1
pactoys r65.b5fcc0f-1
po4a 0.74-1
python-pip 26.2.1-1
zip 3.0-5

@Thanatomanic

Thanatomanic commented Aug 23, 2026

Copy link
Copy Markdown

I managed to get build done on Windows 11 sooner than expected and I have some interesting news. I cannot get any focus stealing in Windows 11. I am not able to reproduce the report in #21829 for Windows 11. One specific thing I noticed is that on Windows 11 there exists a mechanism that the icon in the taskbar will flash up, like a notification. This happens each time a new image is exported, but I don't get focus stealing from other apps.
This flashing does not happen on 5.4.x, and on Windows 10 this was the last version that version that did not steal focus. So something definitely changed there, having different effects on different OSes.

Windows 11

  • darktable 5.4.x -- no focus stealing, no flashing
  • darktable 5.6.x -- no focus stealing, flashing on each exported file
  • darktable master (08217c2) -- same as 5.6.x

Windows 10

  • darktable 5.4.x -- no focus stealing
  • darktable 5.6.x onwards, including this PR -- focus stealing

@lintujuh

Copy link
Copy Markdown

No focus stealing when minimized.

Now that @Thanatomanic pointed it out, I also noticed the flashing of the dt icon on the taskbar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix pull request fixing a bug scope: UI user interface and interactions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Darktable on Windows steals focus each time a progress message pops-up

4 participants