diff options
| author | Po Lu | 2022-07-07 02:48:19 +0000 |
|---|---|---|
| committer | Po Lu | 2022-07-07 02:48:19 +0000 |
| commit | fd016ea99724f7abedfddbb470ab96ece6ddf4ae (patch) | |
| tree | e874e42b2a69d1c22411e2a78c1fa9d2a4270284 /src/haiku_support.cc | |
| parent | 8575962d46d1f1d08836bf00cb74ccd344953bcb (diff) | |
| download | emacs-fd016ea99724f7abedfddbb470ab96ece6ddf4ae.tar.gz emacs-fd016ea99724f7abedfddbb470ab96ece6ddf4ae.zip | |
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/>. */ | |||
| 21 | 21 | ||
| 22 | #include <app/Application.h> | 22 | #include <app/Application.h> |
| 23 | #include <app/Cursor.h> | 23 | #include <app/Cursor.h> |
| 24 | #include <app/Clipboard.h> | ||
| 24 | #include <app/Messenger.h> | 25 | #include <app/Messenger.h> |
| 25 | #include <app/Roster.h> | 26 | #include <app/Roster.h> |
| 26 | 27 | ||
| @@ -648,8 +649,12 @@ public: | |||
| 648 | void | 649 | void |
| 649 | MessageReceived (BMessage *msg) | 650 | MessageReceived (BMessage *msg) |
| 650 | { | 651 | { |
| 652 | struct haiku_clipboard_changed_event rq; | ||
| 653 | |||
| 651 | if (msg->what == QUIT_APPLICATION) | 654 | if (msg->what == QUIT_APPLICATION) |
| 652 | Quit (); | 655 | Quit (); |
| 656 | else if (msg->what == B_CLIPBOARD_CHANGED) | ||
| 657 | haiku_write (CLIPBOARD_CHANGED_EVENT, &rq); | ||
| 653 | else | 658 | else |
| 654 | BApplication::MessageReceived (msg); | 659 | BApplication::MessageReceived (msg); |
| 655 | } | 660 | } |