diff options
| author | Po Lu | 2023-06-21 10:31:05 +0800 |
|---|---|---|
| committer | Po Lu | 2023-06-21 10:31:05 +0800 |
| commit | bdaeecd1759e6aee5ad8bf04ba6ed9bb8fb4453d (patch) | |
| tree | dca4856d9d14f0b4ffa7062e4ff235f46110fadb /src/androidfns.c | |
| parent | 70cf0d7c6f39a53103cb3f6222cedb8345f5d920 (diff) | |
| download | emacs-bdaeecd1759e6aee5ad8bf04ba6ed9bb8fb4453d.tar.gz emacs-bdaeecd1759e6aee5ad8bf04ba6ed9bb8fb4453d.zip | |
Update Android port
* src/androidfns.c (android_set_tool_bar_position):
(frame_geometry):
* src/androidterm.c (android_flash):
(android_clear_under_internal_border): Synchronize with X.
Diffstat (limited to 'src/androidfns.c')
| -rw-r--r-- | src/androidfns.c | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/src/androidfns.c b/src/androidfns.c index 46ff073438a..11ed2e6c00a 100644 --- a/src/androidfns.c +++ b/src/androidfns.c | |||
| @@ -254,15 +254,26 @@ android_set_tool_bar_position (struct frame *f, | |||
| 254 | Lisp_Object new_value, | 254 | Lisp_Object new_value, |
| 255 | Lisp_Object old_value) | 255 | Lisp_Object old_value) |
| 256 | { | 256 | { |
| 257 | Lisp_Object choice = list4 (Qleft, Qright, Qtop, Qbottom); | 257 | if (!EQ (new_value, Qtop) && !EQ (new_value, Qbottom)) |
| 258 | error ("Tool bar position must be either `top' or `bottom'"); | ||
| 258 | 259 | ||
| 259 | if (!NILP (Fmemq (new_value, choice))) | 260 | if (EQ (new_value, old_value)) |
| 260 | { | 261 | return; |
| 261 | if (!EQ (new_value, Qtop)) | 262 | |
| 262 | error ("The only supported tool bar position is top"); | 263 | /* Set the tool bar position. */ |
| 263 | } | 264 | fset_tool_bar_position (f, new_value); |
| 264 | else | 265 | |
| 265 | wrong_choice (choice, new_value); | 266 | /* Now reconfigure frame glyphs to place the tool bar at the |
| 267 | bottom. While the inner height has not changed, call | ||
| 268 | `resize_frame_windows' to place each of the windows at its | ||
| 269 | new position. */ | ||
| 270 | |||
| 271 | adjust_frame_size (f, -1, -1, 3, false, Qtool_bar_position); | ||
| 272 | adjust_frame_glyphs (f); | ||
| 273 | SET_FRAME_GARBAGED (f); | ||
| 274 | |||
| 275 | if (FRAME_ANDROID_WINDOW (f)) | ||
| 276 | android_clear_under_internal_border (f); | ||
| 266 | } | 277 | } |
| 267 | 278 | ||
| 268 | void | 279 | void |
| @@ -1470,7 +1481,7 @@ frame_geometry (Lisp_Object frame, Lisp_Object attribute) | |||
| 1470 | 1481 | ||
| 1471 | tab_bar_height = FRAME_TAB_BAR_HEIGHT (f); | 1482 | tab_bar_height = FRAME_TAB_BAR_HEIGHT (f); |
| 1472 | tab_bar_width = (tab_bar_height | 1483 | tab_bar_width = (tab_bar_height |
| 1473 | ? native_width - 2 * internal_border_width | 1484 | ? native_width - 2 * internal_border_width |
| 1474 | : 0); | 1485 | : 0); |
| 1475 | inner_top += tab_bar_height; | 1486 | inner_top += tab_bar_height; |
| 1476 | 1487 | ||
| @@ -1478,7 +1489,14 @@ frame_geometry (Lisp_Object frame, Lisp_Object attribute) | |||
| 1478 | tool_bar_width = (tool_bar_height | 1489 | tool_bar_width = (tool_bar_height |
| 1479 | ? native_width - 2 * internal_border_width | 1490 | ? native_width - 2 * internal_border_width |
| 1480 | : 0); | 1491 | : 0); |
| 1481 | inner_top += tool_bar_height; | 1492 | |
| 1493 | /* Subtract or add to the inner dimensions based on the tool bar | ||
| 1494 | position. */ | ||
| 1495 | |||
| 1496 | if (EQ (FRAME_TOOL_BAR_POSITION (f), Qtop)) | ||
| 1497 | inner_top += tool_bar_height; | ||
| 1498 | else | ||
| 1499 | inner_bottom -= tool_bar_height; | ||
| 1482 | 1500 | ||
| 1483 | /* Construct list. */ | 1501 | /* Construct list. */ |
| 1484 | if (EQ (attribute, Qouter_edges)) | 1502 | if (EQ (attribute, Qouter_edges)) |