diff options
author | Po Lu <luangruo@yahoo.com> | 2022-07-07 02:48:19 +0000 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2022-07-07 02:48:19 +0000 |
commit | fd016ea99724f7abedfddbb470ab96ece6ddf4ae (patch) | |
tree | e874e42b2a69d1c22411e2a78c1fa9d2a4270284 /src/haiku_support.cc | |
parent | 8575962d46d1f1d08836bf00cb74ccd344953bcb (diff) | |
download | emacs-fd016ea99724f7abedfddbb470ab96ece6ddf4ae.tar.gz |
Port `x-lost-selection-functions' to Haiku
* src/haiku_io.c (haiku_len): Add `CLIPBOARD_CHANGED_EVENT'.
* src/haiku_select.cc (be_update_clipboard_count): Set ownership
flags.
(be_handle_clipboard_changed_message):
(be_start_watching_selection): New functions.
* src/haiku_support.cc (class Emacs): Handle
B_CLIPBOARD_CHANGED.
* src/haiku_support.h (enum haiku_event_type): New event
`CLIPBOARD_CHANGED_EVENT'.
(struct haiku_clipboard_changed_event): New struct.
* src/haikuselect.c (haiku_handle_selection_clear)
(haiku_selection_disowned, haiku_start_watching_selections): New
functions.
(syms_of_haikuselect): New defsym and defvar.
* src/haikuselect.h: Update prototypes.
* src/haikuterm.c (haiku_read_socket): Handle selection events.
(haiku_term_init): Start watching selections.
* src/haikuterm.h: Update prototypes.
* src/keyboard.c (kbd_buffer_get_event, process_special_events)
(mark_kboards): Handle SELECTON_CLEAR_EVENTs correctly on Haiku.
Diffstat (limited to 'src/haiku_support.cc')
-rw-r--r-- | src/haiku_support.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/haiku_support.cc b/src/haiku_support.cc index 7819cef5683..9e38d9556fb 100644 --- a/src/haiku_support.cc +++ b/src/haiku_support.cc @@ -21,6 +21,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ #include <app/Application.h> #include <app/Cursor.h> +#include <app/Clipboard.h> #include <app/Messenger.h> #include <app/Roster.h> @@ -648,8 +649,12 @@ public: void MessageReceived (BMessage *msg) { + struct haiku_clipboard_changed_event rq; + if (msg->what == QUIT_APPLICATION) Quit (); + else if (msg->what == B_CLIPBOARD_CHANGED) + haiku_write (CLIPBOARD_CHANGED_EVENT, &rq); else BApplication::MessageReceived (msg); } |