aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2024-02-18 12:48:41 +0800
committerPo Lu2024-02-18 12:48:41 +0800
commitc2d714886ef139f601d89463675b0d5b49d18ff9 (patch)
tree7a4bc116a2816c61cdea438c692c178923071aa4 /src
parentbd0e281a6a27c048b12847811bc0385acbaa1eec (diff)
downloademacs-c2d714886ef139f601d89463675b0d5b49d18ff9.tar.gz
emacs-c2d714886ef139f601d89463675b0d5b49d18ff9.zip
Implement tooltip_reuse_hidden_frame for Android
* java/org/gnu/emacs/EmacsWindow.java (findSuitableActivityContext): Return Activity rather than Context. (mapWindow): Provide window token manually. * src/androidfns.c (Fx_show_tip, Fx_hide_tip): Respect tooltip_reuse_hidden_frame.
Diffstat (limited to 'src')
-rw-r--r--src/androidfns.c53
1 files changed, 52 insertions, 1 deletions
diff --git a/src/androidfns.c b/src/androidfns.c
index ea3d5f71c7c..0675a0a3c98 100644
--- a/src/androidfns.c
+++ b/src/androidfns.c
@@ -2287,6 +2287,57 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0,
2287 2287
2288 goto start_timer; 2288 goto start_timer;
2289 } 2289 }
2290 else if (tooltip_reuse_hidden_frame && BASE_EQ (frame, tip_last_frame))
2291 {
2292 bool delete = false;
2293 Lisp_Object tail, elt, parm, last;
2294
2295 /* Check if every parameter in PARMS has the same value in
2296 tip_last_parms. This may destruct tip_last_parms which,
2297 however, will be recreated below. */
2298 for (tail = parms; CONSP (tail); tail = XCDR (tail))
2299 {
2300 elt = XCAR (tail);
2301 parm = CAR (elt);
2302 /* The left, top, right and bottom parameters are handled
2303 by compute_tip_xy so they can be ignored here. */
2304 if (!EQ (parm, Qleft) && !EQ (parm, Qtop)
2305 && !EQ (parm, Qright) && !EQ (parm, Qbottom))
2306 {
2307 last = Fassq (parm, tip_last_parms);
2308 if (NILP (Fequal (CDR (elt), CDR (last))))
2309 {
2310 /* We lost, delete the old tooltip. */
2311 delete = true;
2312 break;
2313 }
2314 else
2315 tip_last_parms
2316 = call2 (Qassq_delete_all, parm, tip_last_parms);
2317 }
2318 else
2319 tip_last_parms
2320 = call2 (Qassq_delete_all, parm, tip_last_parms);
2321 }
2322
2323 /* Now check if every parameter in what is left of
2324 tip_last_parms with a non-nil value has an association in
2325 PARMS. */
2326 for (tail = tip_last_parms; CONSP (tail); tail = XCDR (tail))
2327 {
2328 elt = XCAR (tail);
2329 parm = CAR (elt);
2330 if (!EQ (parm, Qleft) && !EQ (parm, Qtop) && !EQ (parm, Qright)
2331 && !EQ (parm, Qbottom) && !NILP (CDR (elt)))
2332 {
2333 /* We lost, delete the old tooltip. */
2334 delete = true;
2335 break;
2336 }
2337 }
2338
2339 android_hide_tip (delete);
2340 }
2290 else 2341 else
2291 android_hide_tip (true); 2342 android_hide_tip (true);
2292 } 2343 }
@@ -2453,7 +2504,7 @@ DEFUN ("x-hide-tip", Fx_hide_tip, Sx_hide_tip, 0, 0, 0,
2453#endif /* 0 */ 2504#endif /* 0 */
2454 return Qnil; 2505 return Qnil;
2455#else /* !ANDROID_STUBIFY */ 2506#else /* !ANDROID_STUBIFY */
2456 return android_hide_tip (true); 2507 return android_hide_tip (!tooltip_reuse_hidden_frame);
2457#endif /* ANDROID_STUBIFY */ 2508#endif /* ANDROID_STUBIFY */
2458} 2509}
2459 2510