1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:07:43 +00:00

LibGUI: Make clipboard-as-bitmap parsing less data-race-y

This encourages the caller to first fetch data and type atomically, and
then parse that, instead of potentially making multiple requests.
This commit is contained in:
Ben Wiederhake 2021-11-20 13:04:38 +01:00 committed by Linus Groh
parent 55526634b6
commit b6419f2cf2
3 changed files with 13 additions and 12 deletions

View file

@ -214,7 +214,7 @@ void MainWidget::initialize_menubar(GUI::Window& window)
auto* editor = current_image_editor();
if (!editor)
return;
auto bitmap = GUI::Clipboard::the().bitmap();
auto bitmap = GUI::Clipboard::the().data_and_type().as_bitmap();
if (!bitmap)
return;