forked from Green-Sky/tomato
make primary selection pasting work
it is also bugged, as SDL misses large parts of selection sources (terminals etc) but browers work
This commit is contained in:
parent
e72aebc043
commit
b1062e701e
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
#include "./media_meta_info_loader.hpp"
|
#include "./media_meta_info_loader.hpp"
|
||||||
#include "./sdl_clipboard_utils.hpp"
|
#include "./sdl_clipboard_utils.hpp"
|
||||||
|
#include "SDL_clipboard.h"
|
||||||
|
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@ -492,6 +493,18 @@ void ChatGui4::render(float time_delta) {
|
|||||||
_text_input_buffer.clear();
|
_text_input_buffer.clear();
|
||||||
evil_enter_looses_focus_hack = true;
|
evil_enter_looses_focus_hack = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// welcome to linux
|
||||||
|
if (ImGui::IsMouseClicked(ImGuiMouseButton_Middle)) {
|
||||||
|
if (!ImGui::IsItemFocused()) {
|
||||||
|
ImGui::SetKeyboardFocusHere(-1);
|
||||||
|
}
|
||||||
|
char* primary_text = SDL_GetPrimarySelectionText();
|
||||||
|
if (primary_text != nullptr) {
|
||||||
|
ImGui::GetIO().AddInputCharactersUTF8(primary_text);
|
||||||
|
SDL_free(primary_text);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ImGui::EndChild();
|
ImGui::EndChild();
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
Loading…
Reference in New Issue
Block a user