Mercurial > vim
annotate src/os_qnx.c @ 26300:0374f55a16be v8.2.3681
patch 8.2.3681: cannot drag popup window after click on a status line
Commit: https://github.com/vim/vim/commit/bfc5786a61693aaadc3e45f80a2f147c3a6711a3
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Nov 26 15:57:40 2021 +0000
patch 8.2.3681: cannot drag popup window after click on a status line
Problem: Cannot drag popup window after click on a status line. (Sergey
Vlasov)
Solution: Reset on_status_line. (closes #9221)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 26 Nov 2021 17:00:04 +0100 |
parents | 44b855153d8e |
children | 3365a601e73b |
rev | line source |
---|---|
10042
4aead6a9b7a9
commit https://github.com/vim/vim/commit/edf3f97ae2af024708ebb4ac614227327033ca47
Christian Brabandt <cb@256bit.org>
parents:
7833
diff
changeset
|
1 /* vi:set ts=8 sts=4 sw=4 noet: |
7 | 2 * |
3 * VIM - Vi IMproved by Bram Moolenaar | |
4 * | |
5 * QNX port by Julian Kinraid | |
6 * | |
7 * Do ":help uganda" in Vim to read copying and usage conditions. | |
8 * Do ":help credits" in Vim to see a list of people who contributed. | |
9 */ | |
10 | |
11 /* | |
12 * os_qnx.c | |
13 */ | |
14 | |
15 #include "vim.h" | |
16 | |
17 | |
18 #if defined(FEAT_GUI_PHOTON) | |
19 int is_photon_available; | |
20 #endif | |
21 | |
7833
c079097365f3
commit https://github.com/vim/vim/commit/055409764ca5f7978d4c399d2c440af0ce971c4f
Christian Brabandt <cb@256bit.org>
parents:
5735
diff
changeset
|
22 void qnx_init(void) |
7 | 23 { |
24 #if defined(FEAT_GUI_PHOTON) | |
25 PhChannelParms_t parms; | |
26 | |
3100 | 27 memset(&parms, 0, sizeof(parms)); |
7 | 28 parms.flags = Ph_DYNAMIC_BUFFER; |
29 | |
3100 | 30 is_photon_available = (PhAttach(NULL, &parms) != NULL) ? TRUE : FALSE; |
7 | 31 #endif |
32 } | |
33 | |
34 #if (defined(FEAT_GUI_PHOTON) && defined(FEAT_CLIPBOARD)) || defined(PROTO) | |
35 | |
36 #define CLIP_TYPE_VIM "VIMTYPE" | |
37 #define CLIP_TYPE_TEXT "TEXT" | |
38 | |
18810
44b855153d8e
patch 8.1.2393: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
17063
diff
changeset
|
39 // Turn on the clipboard for a console vim when photon is running |
7833
c079097365f3
commit https://github.com/vim/vim/commit/055409764ca5f7978d4c399d2c440af0ce971c4f
Christian Brabandt <cb@256bit.org>
parents:
5735
diff
changeset
|
40 void qnx_clip_init(void) |
7 | 41 { |
3100 | 42 if (is_photon_available == TRUE && !gui.in_use) |
43 clip_init(TRUE); | |
7 | 44 } |
45 | |
18810
44b855153d8e
patch 8.1.2393: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
17063
diff
changeset
|
46 ///////////////////////////////////////////////////////////////////////////// |
44b855153d8e
patch 8.1.2393: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
17063
diff
changeset
|
47 // Clipboard |
7 | 48 |
18810
44b855153d8e
patch 8.1.2393: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
17063
diff
changeset
|
49 // No support for owning the clipboard |
7 | 50 int |
17063
3147c7c2e86b
patch 8.1.1531: clipboard type name is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
16768
diff
changeset
|
51 clip_mch_own_selection(Clipboard_T *cbd) |
7 | 52 { |
53 return FALSE; | |
54 } | |
55 | |
56 void | |
17063
3147c7c2e86b
patch 8.1.1531: clipboard type name is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
16768
diff
changeset
|
57 clip_mch_lose_selection(Clipboard_T *cbd) |
7 | 58 { |
59 } | |
60 | |
61 void | |
17063
3147c7c2e86b
patch 8.1.1531: clipboard type name is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
16768
diff
changeset
|
62 clip_mch_request_selection(Clipboard_T *cbd) |
7 | 63 { |
64 int type = MLINE, clip_length = 0, is_type_set = FALSE; | |
65 void *cbdata; | |
66 PhClipHeader *clip_header; | |
67 char_u *clip_text = NULL; | |
68 | |
3100 | 69 cbdata = PhClipboardPasteStart(PhInputGroup(NULL)); |
70 if (cbdata != NULL) | |
7 | 71 { |
18810
44b855153d8e
patch 8.1.2393: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
17063
diff
changeset
|
72 // Look for the vim specific clip first |
3100 | 73 clip_header = PhClipboardPasteType(cbdata, CLIP_TYPE_VIM); |
74 if (clip_header != NULL && clip_header->data != NULL) | |
7 | 75 { |
3100 | 76 switch(*(char *) clip_header->data) |
7 | 77 { |
18810
44b855153d8e
patch 8.1.2393: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
17063
diff
changeset
|
78 default: // fallthrough to line type |
7 | 79 case 'L': type = MLINE; break; |
80 case 'C': type = MCHAR; break; | |
81 case 'B': type = MBLOCK; break; | |
82 } | |
83 is_type_set = TRUE; | |
84 } | |
85 | |
18810
44b855153d8e
patch 8.1.2393: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
17063
diff
changeset
|
86 // Try for just normal text |
3100 | 87 clip_header = PhClipboardPasteType(cbdata, CLIP_TYPE_TEXT); |
88 if (clip_header != NULL) | |
7 | 89 { |
90 clip_text = clip_header->data; | |
91 clip_length = clip_header->length - 1; | |
92 | |
3100 | 93 if (clip_text != NULL && is_type_set == FALSE) |
2896 | 94 type = MAUTO; |
7 | 95 } |
96 | |
3100 | 97 if ((clip_text != NULL) && (clip_length > 0)) |
98 clip_yank_selection(type, clip_text, clip_length, cbd); | |
7 | 99 |
3100 | 100 PhClipboardPasteFinish(cbdata); |
7 | 101 } |
102 } | |
103 | |
104 void | |
17063
3147c7c2e86b
patch 8.1.1531: clipboard type name is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
16768
diff
changeset
|
105 clip_mch_set_selection(Clipboard_T *cbd) |
7 | 106 { |
107 int type; | |
108 long_u len; | |
109 char_u *text_clip, vim_clip[2], *str = NULL; | |
110 PhClipHeader clip_header[2]; | |
111 | |
18810
44b855153d8e
patch 8.1.2393: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
17063
diff
changeset
|
112 // Prevent recursion from clip_get_selection() |
3100 | 113 if (cbd->owned == TRUE) |
7 | 114 return; |
115 | |
116 cbd->owned = TRUE; | |
3100 | 117 clip_get_selection(cbd); |
7 | 118 cbd->owned = FALSE; |
119 | |
3100 | 120 type = clip_convert_selection(&str, &len, cbd); |
121 if (type >= 0) | |
7 | 122 { |
16768
695d9ef00b03
patch 8.1.1386: unessesary type casts for lalloc()
Bram Moolenaar <Bram@vim.org>
parents:
16162
diff
changeset
|
123 text_clip = alloc(len + 1); // Normal text |
7 | 124 |
3100 | 125 if (text_clip && vim_clip) |
7 | 126 { |
3100 | 127 memset(clip_header, 0, sizeof(clip_header)); |
7 | 128 |
3100 | 129 STRNCPY(clip_header[0].type, CLIP_TYPE_VIM, 8); |
130 clip_header[0].length = sizeof(vim_clip); | |
7 | 131 clip_header[0].data = vim_clip; |
132 | |
3100 | 133 STRNCPY(clip_header[1].type, CLIP_TYPE_TEXT, 8); |
7 | 134 clip_header[1].length = len + 1; |
135 clip_header[1].data = text_clip; | |
136 | |
3100 | 137 switch(type) |
7 | 138 { |
18810
44b855153d8e
patch 8.1.2393: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents:
17063
diff
changeset
|
139 default: // fallthrough to MLINE |
7 | 140 case MLINE: *vim_clip = 'L'; break; |
141 case MCHAR: *vim_clip = 'C'; break; | |
142 case MBLOCK: *vim_clip = 'B'; break; | |
143 } | |
144 | |
3100 | 145 vim_strncpy(text_clip, str, len); |
7 | 146 |
147 vim_clip[ 1 ] = NUL; | |
148 | |
3100 | 149 PhClipboardCopy(PhInputGroup(NULL), 2, clip_header); |
7 | 150 } |
3100 | 151 vim_free(text_clip); |
7 | 152 } |
3100 | 153 vim_free(str); |
7 | 154 } |
155 #endif |