diff options
| -rw-r--r-- | doc/lispref/frames.texi | 14 | ||||
| -rw-r--r-- | src/haiku_support.cc | 242 | ||||
| -rw-r--r-- | src/haiku_support.h | 14 | ||||
| -rw-r--r-- | src/haikufns.c | 2 | ||||
| -rw-r--r-- | src/haikuterm.c | 47 | ||||
| -rw-r--r-- | src/haikuterm.h | 11 |
6 files changed, 183 insertions, 147 deletions
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index 5853c45b79e..5ea060871f4 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi | |||
| @@ -1734,16 +1734,14 @@ fit will be clipped by the window manager. | |||
| 1734 | @item fullscreen | 1734 | @item fullscreen |
| 1735 | This parameter specifies whether to maximize the frame's width, height | 1735 | This parameter specifies whether to maximize the frame's width, height |
| 1736 | or both. Its value can be @code{fullwidth}, @code{fullheight}, | 1736 | or both. Its value can be @code{fullwidth}, @code{fullheight}, |
| 1737 | @code{fullboth}, or @code{maximized}.@footnote{On Haiku, setting | 1737 | @code{fullboth}, or @code{maximized}. A @dfn{fullwidth} frame is as |
| 1738 | @code{fullscreen} to @code{fullwidth} or @code{fullheight} has no | ||
| 1739 | effect.} A @dfn{fullwidth} frame is as | ||
| 1740 | wide as possible, a @dfn{fullheight} frame is as tall as possible, and | 1738 | wide as possible, a @dfn{fullheight} frame is as tall as possible, and |
| 1741 | a @dfn{fullboth} frame is both as wide and as tall as possible. A | 1739 | a @dfn{fullboth} frame is both as wide and as tall as possible. A |
| 1742 | @dfn{maximized} frame is like a ``fullboth'' frame, except that it usually | 1740 | @dfn{maximized} frame is like a ``fullboth'' frame, except that it |
| 1743 | keeps its title bar and the buttons for resizing | 1741 | usually keeps its title bar and the buttons for resizing and closing |
| 1744 | and closing the frame. Also, maximized frames typically avoid hiding | 1742 | the frame. Also, maximized frames typically avoid hiding any task bar |
| 1745 | any task bar or panels displayed on the desktop. A ``fullboth'' frame, | 1743 | or panels displayed on the desktop. A ``fullboth'' frame, on the |
| 1746 | on the other hand, usually omits the title bar and occupies the entire | 1744 | other hand, usually omits the title bar and occupies the entire |
| 1747 | available screen space. | 1745 | available screen space. |
| 1748 | 1746 | ||
| 1749 | Full-height and full-width frames are more similar to maximized | 1747 | Full-height and full-width frames are more similar to maximized |
diff --git a/src/haiku_support.cc b/src/haiku_support.cc index 0c126dab3d6..0b3ab4cf4ae 100644 --- a/src/haiku_support.cc +++ b/src/haiku_support.cc | |||
| @@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License | |||
| 17 | along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | 17 | along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ |
| 18 | 18 | ||
| 19 | #include <config.h> | 19 | #include <config.h> |
| 20 | #include <attribute.h> | ||
| 20 | 21 | ||
| 21 | #include <app/Application.h> | 22 | #include <app/Application.h> |
| 22 | #include <app/Cursor.h> | 23 | #include <app/Cursor.h> |
| @@ -518,33 +519,42 @@ public: | |||
| 518 | struct child_frame *next; | 519 | struct child_frame *next; |
| 519 | int xoff, yoff; | 520 | int xoff, yoff; |
| 520 | EmacsWindow *window; | 521 | EmacsWindow *window; |
| 521 | } *subset_windows = NULL; | 522 | } *subset_windows; |
| 522 | 523 | ||
| 523 | EmacsWindow *parent = NULL; | 524 | EmacsWindow *parent; |
| 524 | BRect pre_fullscreen_rect; | 525 | BRect pre_fullscreen_rect; |
| 525 | BRect pre_zoom_rect; | 526 | BRect pre_zoom_rect; |
| 526 | int x_before_zoom = INT_MIN; | 527 | int x_before_zoom; |
| 527 | int y_before_zoom = INT_MIN; | 528 | int y_before_zoom; |
| 528 | bool fullscreen_p = false; | 529 | bool shown_flag; |
| 529 | bool zoomed_p = false; | 530 | volatile bool was_shown_p; |
| 530 | bool shown_flag = false; | 531 | bool menu_bar_active_p; |
| 531 | volatile int was_shown_p = 0; | 532 | bool override_redirect_p; |
| 532 | bool menu_bar_active_p = false; | ||
| 533 | bool override_redirect_p = false; | ||
| 534 | window_look pre_override_redirect_look; | 533 | window_look pre_override_redirect_look; |
| 535 | window_feel pre_override_redirect_feel; | 534 | window_feel pre_override_redirect_feel; |
| 536 | uint32 pre_override_redirect_workspaces; | 535 | uint32 pre_override_redirect_workspaces; |
| 537 | int window_id; | 536 | int window_id; |
| 538 | bool *menus_begun = NULL; | 537 | bool *menus_begun; |
| 539 | enum haiku_z_group z_group; | 538 | enum haiku_z_group z_group; |
| 540 | bool tooltip_p = false; | 539 | bool tooltip_p; |
| 540 | enum haiku_fullscreen_mode fullscreen_mode; | ||
| 541 | 541 | ||
| 542 | EmacsWindow () : BWindow (BRect (0, 0, 0, 0), "", B_TITLED_WINDOW_LOOK, | 542 | EmacsWindow () : BWindow (BRect (0, 0, 0, 0), "", B_TITLED_WINDOW_LOOK, |
| 543 | B_NORMAL_WINDOW_FEEL, B_NO_SERVER_SIDE_WINDOW_MODIFIERS) | 543 | B_NORMAL_WINDOW_FEEL, B_NO_SERVER_SIDE_WINDOW_MODIFIERS), |
| 544 | subset_windows (NULL), | ||
| 545 | parent (NULL), | ||
| 546 | x_before_zoom (INT_MIN), | ||
| 547 | y_before_zoom (INT_MIN), | ||
| 548 | shown_flag (false), | ||
| 549 | was_shown_p (false), | ||
| 550 | menu_bar_active_p (false), | ||
| 551 | override_redirect_p (false), | ||
| 552 | window_id (current_window_id), | ||
| 553 | menus_begun (NULL), | ||
| 554 | z_group (Z_GROUP_NONE), | ||
| 555 | tooltip_p (false), | ||
| 556 | fullscreen_mode (FULLSCREEN_MODE_NONE) | ||
| 544 | { | 557 | { |
| 545 | window_id = current_window_id++; | ||
| 546 | z_group = Z_GROUP_NONE; | ||
| 547 | |||
| 548 | /* This pulse rate is used by scroll bars for repeating a button | 558 | /* This pulse rate is used by scroll bars for repeating a button |
| 549 | action while a button is held down. */ | 559 | action while a button is held down. */ |
| 550 | SetPulseRate (30000); | 560 | SetPulseRate (30000); |
| @@ -711,12 +721,6 @@ public: | |||
| 711 | RecomputeFeel (); | 721 | RecomputeFeel (); |
| 712 | UpwardsUnSubsetChildren (parent); | 722 | UpwardsUnSubsetChildren (parent); |
| 713 | this->RemoveFromSubset (this); | 723 | this->RemoveFromSubset (this); |
| 714 | |||
| 715 | if (fullscreen_p) | ||
| 716 | { | ||
| 717 | fullscreen_p = 0; | ||
| 718 | MakeFullscreen (1); | ||
| 719 | } | ||
| 720 | child_frame_lock.Unlock (); | 724 | child_frame_lock.Unlock (); |
| 721 | } | 725 | } |
| 722 | 726 | ||
| @@ -766,11 +770,6 @@ public: | |||
| 766 | this->AddToSubset (this); | 770 | this->AddToSubset (this); |
| 767 | if (!IsHidden () && this->parent) | 771 | if (!IsHidden () && this->parent) |
| 768 | UpwardsSubsetChildren (parent); | 772 | UpwardsSubsetChildren (parent); |
| 769 | if (fullscreen_p) | ||
| 770 | { | ||
| 771 | fullscreen_p = 0; | ||
| 772 | MakeFullscreen (1); | ||
| 773 | } | ||
| 774 | window->LinkChild (this); | 773 | window->LinkChild (this); |
| 775 | 774 | ||
| 776 | child_frame_lock.Unlock (); | 775 | child_frame_lock.Unlock (); |
| @@ -1161,41 +1160,103 @@ public: | |||
| 1161 | } | 1160 | } |
| 1162 | 1161 | ||
| 1163 | void | 1162 | void |
| 1164 | Zoom (BPoint o, float w, float h) | 1163 | ClearFullscreen (void) |
| 1165 | { | 1164 | { |
| 1166 | struct haiku_zoom_event rq; | 1165 | switch (fullscreen_mode) |
| 1167 | BRect rect; | 1166 | { |
| 1168 | rq.window = this; | 1167 | case FULLSCREEN_MODE_MAXIMIZED: |
| 1168 | BWindow::Zoom (pre_zoom_rect.LeftTop (), | ||
| 1169 | BE_RECT_WIDTH (pre_zoom_rect) - 1, | ||
| 1170 | BE_RECT_HEIGHT (pre_zoom_rect) - 1); | ||
| 1171 | break; | ||
| 1169 | 1172 | ||
| 1170 | if (fullscreen_p) | 1173 | case FULLSCREEN_MODE_BOTH: |
| 1171 | MakeFullscreen (0); | 1174 | case FULLSCREEN_MODE_HEIGHT: |
| 1175 | case FULLSCREEN_MODE_WIDTH: | ||
| 1176 | MoveTo (pre_fullscreen_rect.LeftTop ()); | ||
| 1177 | ResizeTo (BE_RECT_WIDTH (pre_fullscreen_rect) - 1, | ||
| 1178 | BE_RECT_HEIGHT (pre_fullscreen_rect) - 1); | ||
| 1172 | 1179 | ||
| 1173 | if (!zoomed_p) | 1180 | SetFlags (Flags () & ~(B_NOT_MOVABLE |
| 1174 | { | 1181 | | B_NOT_ZOOMABLE |
| 1175 | pre_zoom_rect = Frame (); | 1182 | | B_NOT_RESIZABLE)); |
| 1176 | zoomed_p = true; | 1183 | break; |
| 1177 | rect = CalculateZoomRect (); | 1184 | |
| 1178 | } | 1185 | case FULLSCREEN_MODE_NONE: |
| 1179 | else | 1186 | break; |
| 1180 | { | ||
| 1181 | zoomed_p = false; | ||
| 1182 | rect = pre_zoom_rect; | ||
| 1183 | } | 1187 | } |
| 1184 | 1188 | ||
| 1185 | rq.zoomed = zoomed_p; | 1189 | fullscreen_mode = FULLSCREEN_MODE_NONE; |
| 1186 | haiku_write (ZOOM_EVENT, &rq); | 1190 | } |
| 1187 | 1191 | ||
| 1188 | BWindow::Zoom (rect.LeftTop (), BE_RECT_WIDTH (rect) - 1, | 1192 | BRect |
| 1189 | BE_RECT_HEIGHT (rect) - 1); | 1193 | FullscreenRectForMode (enum haiku_fullscreen_mode mode) |
| 1194 | { | ||
| 1195 | BScreen screen (this); | ||
| 1196 | BRect frame; | ||
| 1197 | |||
| 1198 | if (!screen.IsValid ()) | ||
| 1199 | return BRect (0, 0, 0, 0); | ||
| 1200 | |||
| 1201 | frame = screen.Frame (); | ||
| 1202 | |||
| 1203 | if (mode == FULLSCREEN_MODE_HEIGHT) | ||
| 1204 | frame.right -= BE_RECT_WIDTH (frame) / 2; | ||
| 1205 | else if (mode == FULLSCREEN_MODE_WIDTH) | ||
| 1206 | frame.bottom -= BE_RECT_HEIGHT (frame) / 2; | ||
| 1207 | |||
| 1208 | return frame; | ||
| 1190 | } | 1209 | } |
| 1191 | 1210 | ||
| 1192 | void | 1211 | void |
| 1193 | UnZoom (void) | 1212 | SetFullscreen (enum haiku_fullscreen_mode mode) |
| 1194 | { | 1213 | { |
| 1195 | if (!zoomed_p) | 1214 | BRect zoom_rect; |
| 1215 | |||
| 1216 | if (fullscreen_mode == mode) | ||
| 1196 | return; | 1217 | return; |
| 1197 | 1218 | ||
| 1198 | BWindow::Zoom (); | 1219 | ClearFullscreen (); |
| 1220 | |||
| 1221 | switch (mode) | ||
| 1222 | { | ||
| 1223 | case FULLSCREEN_MODE_MAXIMIZED: | ||
| 1224 | pre_zoom_rect = Frame (); | ||
| 1225 | zoom_rect = CalculateZoomRect (); | ||
| 1226 | BWindow::Zoom (zoom_rect.LeftTop (), | ||
| 1227 | BE_RECT_WIDTH (zoom_rect) - 1, | ||
| 1228 | BE_RECT_HEIGHT (zoom_rect) - 1); | ||
| 1229 | break; | ||
| 1230 | |||
| 1231 | case FULLSCREEN_MODE_BOTH: | ||
| 1232 | SetFlags (Flags () | B_NOT_MOVABLE); | ||
| 1233 | FALLTHROUGH; | ||
| 1234 | |||
| 1235 | case FULLSCREEN_MODE_HEIGHT: | ||
| 1236 | case FULLSCREEN_MODE_WIDTH: | ||
| 1237 | SetFlags (Flags () | B_NOT_ZOOMABLE | B_NOT_RESIZABLE); | ||
| 1238 | pre_fullscreen_rect = Frame (); | ||
| 1239 | zoom_rect = FullscreenRectForMode (mode); | ||
| 1240 | ResizeTo (BE_RECT_WIDTH (zoom_rect) - 1, | ||
| 1241 | BE_RECT_HEIGHT (zoom_rect) - 1); | ||
| 1242 | MoveTo (zoom_rect.left, zoom_rect.top); | ||
| 1243 | |||
| 1244 | break; | ||
| 1245 | |||
| 1246 | case FULLSCREEN_MODE_NONE: | ||
| 1247 | break; | ||
| 1248 | } | ||
| 1249 | |||
| 1250 | fullscreen_mode = mode; | ||
| 1251 | } | ||
| 1252 | |||
| 1253 | void | ||
| 1254 | Zoom (BPoint o, float w, float h) | ||
| 1255 | { | ||
| 1256 | struct haiku_zoom_event rq; | ||
| 1257 | |||
| 1258 | rq.window = this; | ||
| 1259 | haiku_write (ZOOM_EVENT, &rq); | ||
| 1199 | } | 1260 | } |
| 1200 | 1261 | ||
| 1201 | void | 1262 | void |
| @@ -1218,51 +1279,6 @@ public: | |||
| 1218 | child_frame_lock.Lock (); | 1279 | child_frame_lock.Lock (); |
| 1219 | gui_abort ("Trying to calculate offsets for a child frame that doesn't exist"); | 1280 | gui_abort ("Trying to calculate offsets for a child frame that doesn't exist"); |
| 1220 | } | 1281 | } |
| 1221 | |||
| 1222 | void | ||
| 1223 | MakeFullscreen (int make_fullscreen_p) | ||
| 1224 | { | ||
| 1225 | BScreen screen (this); | ||
| 1226 | uint32 flags; | ||
| 1227 | BRect screen_frame; | ||
| 1228 | |||
| 1229 | if (!screen.IsValid ()) | ||
| 1230 | gui_abort ("Trying to make a window fullscreen without a screen"); | ||
| 1231 | |||
| 1232 | screen_frame = screen.Frame (); | ||
| 1233 | UnZoom (); | ||
| 1234 | |||
| 1235 | if (make_fullscreen_p == fullscreen_p) | ||
| 1236 | return; | ||
| 1237 | |||
| 1238 | fullscreen_p = make_fullscreen_p; | ||
| 1239 | flags = Flags (); | ||
| 1240 | |||
| 1241 | if (fullscreen_p) | ||
| 1242 | { | ||
| 1243 | if (zoomed_p) | ||
| 1244 | UnZoom (); | ||
| 1245 | |||
| 1246 | flags |= B_NOT_MOVABLE | B_NOT_ZOOMABLE; | ||
| 1247 | pre_fullscreen_rect = Frame (); | ||
| 1248 | |||
| 1249 | MoveTo (0, 0); | ||
| 1250 | ResizeTo (BE_RECT_WIDTH (screen_frame) - 1, | ||
| 1251 | BE_RECT_HEIGHT (screen_frame) - 1); | ||
| 1252 | } | ||
| 1253 | else | ||
| 1254 | { | ||
| 1255 | flags &= ~(B_NOT_MOVABLE | B_NOT_ZOOMABLE); | ||
| 1256 | |||
| 1257 | /* Use MoveTo directly since pre_fullscreen_rect isn't | ||
| 1258 | adjusted for decorator sizes. */ | ||
| 1259 | MoveTo (pre_fullscreen_rect.left, | ||
| 1260 | pre_fullscreen_rect.top); | ||
| 1261 | ResizeTo (BE_RECT_WIDTH (pre_fullscreen_rect) - 1, | ||
| 1262 | BE_RECT_HEIGHT (pre_fullscreen_rect) - 1); | ||
| 1263 | } | ||
| 1264 | SetFlags (flags); | ||
| 1265 | } | ||
| 1266 | }; | 1282 | }; |
| 1267 | 1283 | ||
| 1268 | class EmacsMenuBar : public BMenuBar | 1284 | class EmacsMenuBar : public BMenuBar |
| @@ -4486,30 +4502,6 @@ be_popup_file_dialog (int open_p, const char *default_dir, int must_match_p, | |||
| 4486 | return file_name; | 4502 | return file_name; |
| 4487 | } | 4503 | } |
| 4488 | 4504 | ||
| 4489 | /* Zoom WINDOW. */ | ||
| 4490 | void | ||
| 4491 | BWindow_zoom (void *window) | ||
| 4492 | { | ||
| 4493 | BWindow *w = (BWindow *) window; | ||
| 4494 | w->Zoom (); | ||
| 4495 | } | ||
| 4496 | |||
| 4497 | /* Make WINDOW fullscreen if FULLSCREEN_P. */ | ||
| 4498 | void | ||
| 4499 | EmacsWindow_make_fullscreen (void *window, int fullscreen_p) | ||
| 4500 | { | ||
| 4501 | EmacsWindow *w = (EmacsWindow *) window; | ||
| 4502 | w->MakeFullscreen (fullscreen_p); | ||
| 4503 | } | ||
| 4504 | |||
| 4505 | /* Unzoom (maximize) WINDOW. */ | ||
| 4506 | void | ||
| 4507 | EmacsWindow_unzoom (void *window) | ||
| 4508 | { | ||
| 4509 | EmacsWindow *w = (EmacsWindow *) window; | ||
| 4510 | w->UnZoom (); | ||
| 4511 | } | ||
| 4512 | |||
| 4513 | /* Move the pointer into MBAR and start tracking. Return whether the | 4505 | /* Move the pointer into MBAR and start tracking. Return whether the |
| 4514 | menu bar was opened correctly. */ | 4506 | menu bar was opened correctly. */ |
| 4515 | bool | 4507 | bool |
| @@ -5180,3 +5172,15 @@ be_unlock_window (void *window) | |||
| 5180 | 5172 | ||
| 5181 | wnd->UnlockLooper (); | 5173 | wnd->UnlockLooper (); |
| 5182 | } | 5174 | } |
| 5175 | |||
| 5176 | void | ||
| 5177 | be_set_window_fullscreen_mode (void *window, enum haiku_fullscreen_mode mode) | ||
| 5178 | { | ||
| 5179 | EmacsWindow *w = (EmacsWindow *) window; | ||
| 5180 | |||
| 5181 | if (!w->LockLooper ()) | ||
| 5182 | gui_abort ("Failed to lock window to set fullscreen mode"); | ||
| 5183 | |||
| 5184 | w->SetFullscreen (mode); | ||
| 5185 | w->UnlockLooper (); | ||
| 5186 | } | ||
diff --git a/src/haiku_support.h b/src/haiku_support.h index 14dd36e275a..0bfd027c0d3 100644 --- a/src/haiku_support.h +++ b/src/haiku_support.h | |||
| @@ -249,7 +249,6 @@ struct haiku_menu_bar_help_event | |||
| 249 | struct haiku_zoom_event | 249 | struct haiku_zoom_event |
| 250 | { | 250 | { |
| 251 | void *window; | 251 | void *window; |
| 252 | bool zoomed; | ||
| 253 | }; | 252 | }; |
| 254 | 253 | ||
| 255 | enum haiku_font_specification | 254 | enum haiku_font_specification |
| @@ -316,6 +315,15 @@ enum haiku_font_weight | |||
| 316 | HAIKU_MEDIUM = 2000, | 315 | HAIKU_MEDIUM = 2000, |
| 317 | }; | 316 | }; |
| 318 | 317 | ||
| 318 | enum haiku_fullscreen_mode | ||
| 319 | { | ||
| 320 | FULLSCREEN_MODE_NONE, | ||
| 321 | FULLSCREEN_MODE_WIDTH, | ||
| 322 | FULLSCREEN_MODE_HEIGHT, | ||
| 323 | FULLSCREEN_MODE_BOTH, | ||
| 324 | FULLSCREEN_MODE_MAXIMIZED, | ||
| 325 | }; | ||
| 326 | |||
| 319 | struct haiku_font_pattern | 327 | struct haiku_font_pattern |
| 320 | { | 328 | { |
| 321 | /* Bitmask indicating which fields are set. */ | 329 | /* Bitmask indicating which fields are set. */ |
| @@ -495,7 +503,6 @@ extern void BWindow_center_on_screen (void *); | |||
| 495 | extern void BWindow_change_decoration (void *, int); | 503 | extern void BWindow_change_decoration (void *, int); |
| 496 | extern void BWindow_set_tooltip_decoration (void *); | 504 | extern void BWindow_set_tooltip_decoration (void *); |
| 497 | extern void BWindow_set_avoid_focus (void *, int); | 505 | extern void BWindow_set_avoid_focus (void *, int); |
| 498 | extern void BWindow_zoom (void *); | ||
| 499 | extern void BWindow_set_size_alignment (void *, int, int); | 506 | extern void BWindow_set_size_alignment (void *, int, int); |
| 500 | extern void BWindow_sync (void *); | 507 | extern void BWindow_sync (void *); |
| 501 | extern void BWindow_send_behind (void *, void *); | 508 | extern void BWindow_send_behind (void *, void *); |
| @@ -623,8 +630,6 @@ extern void BAlert_delete (void *); | |||
| 623 | extern void EmacsWindow_parent_to (void *, void *); | 630 | extern void EmacsWindow_parent_to (void *, void *); |
| 624 | extern void EmacsWindow_unparent (void *); | 631 | extern void EmacsWindow_unparent (void *); |
| 625 | extern void EmacsWindow_move_weak_child (void *, void *, int, int); | 632 | extern void EmacsWindow_move_weak_child (void *, void *, int, int); |
| 626 | extern void EmacsWindow_make_fullscreen (void *, int); | ||
| 627 | extern void EmacsWindow_unzoom (void *); | ||
| 628 | 633 | ||
| 629 | extern void be_get_version_string (char *, int); | 634 | extern void be_get_version_string (char *, int); |
| 630 | extern int be_get_display_planes (void); | 635 | extern int be_get_display_planes (void); |
| @@ -690,6 +695,7 @@ extern status_t be_roster_launch (const char *, const char *, char **, | |||
| 690 | extern void be_get_window_decorator_dimensions (void *, int *, int *, int *, int *); | 695 | extern void be_get_window_decorator_dimensions (void *, int *, int *, int *, int *); |
| 691 | extern void be_get_window_decorator_frame (void *, int *, int *, int *, int *); | 696 | extern void be_get_window_decorator_frame (void *, int *, int *, int *, int *); |
| 692 | extern void be_send_move_frame_event (void *); | 697 | extern void be_send_move_frame_event (void *); |
| 698 | extern void be_set_window_fullscreen_mode (void *, enum haiku_fullscreen_mode); | ||
| 693 | 699 | ||
| 694 | extern void be_lock_window (void *); | 700 | extern void be_lock_window (void *); |
| 695 | extern void be_unlock_window (void *); | 701 | extern void be_unlock_window (void *); |
diff --git a/src/haikufns.c b/src/haikufns.c index 76a8569970a..314152008b0 100644 --- a/src/haikufns.c +++ b/src/haikufns.c | |||
| @@ -2281,7 +2281,7 @@ DEFUN ("x-display-pixel-height", Fx_display_pixel_height, Sx_display_pixel_heigh | |||
| 2281 | check_haiku_display_info (terminal); | 2281 | check_haiku_display_info (terminal); |
| 2282 | 2282 | ||
| 2283 | be_get_screen_dimensions (&width, &height); | 2283 | be_get_screen_dimensions (&width, &height); |
| 2284 | return make_fixnum (width); | 2284 | return make_fixnum (height); |
| 2285 | } | 2285 | } |
| 2286 | 2286 | ||
| 2287 | DEFUN ("x-display-mm-height", Fx_display_mm_height, Sx_display_mm_height, 0, 1, 0, | 2287 | DEFUN ("x-display-mm-height", Fx_display_mm_height, Sx_display_mm_height, 0, 1, 0, |
diff --git a/src/haikuterm.c b/src/haikuterm.c index 2db1e352ffb..731afd9d394 100644 --- a/src/haikuterm.c +++ b/src/haikuterm.c | |||
| @@ -3018,11 +3018,20 @@ static struct redisplay_interface haiku_redisplay_interface = | |||
| 3018 | static void | 3018 | static void |
| 3019 | haiku_make_fullscreen_consistent (struct frame *f) | 3019 | haiku_make_fullscreen_consistent (struct frame *f) |
| 3020 | { | 3020 | { |
| 3021 | Lisp_Object lval = get_frame_param (f, Qfullscreen); | 3021 | Lisp_Object lval; |
| 3022 | 3022 | struct haiku_output *output; | |
| 3023 | if (!EQ (lval, Qmaximized) && FRAME_OUTPUT_DATA (f)->zoomed_p) | 3023 | |
| 3024 | output = FRAME_OUTPUT_DATA (f); | ||
| 3025 | |||
| 3026 | if (output->fullscreen_mode == FULLSCREEN_MODE_BOTH) | ||
| 3027 | lval = Qfullboth; | ||
| 3028 | else if (output->fullscreen_mode == FULLSCREEN_MODE_WIDTH) | ||
| 3029 | lval = Qfullwidth; | ||
| 3030 | else if (output->fullscreen_mode == FULLSCREEN_MODE_HEIGHT) | ||
| 3031 | lval = Qfullheight; | ||
| 3032 | else if (output->fullscreen_mode == FULLSCREEN_MODE_MAXIMIZED) | ||
| 3024 | lval = Qmaximized; | 3033 | lval = Qmaximized; |
| 3025 | else if (EQ (lval, Qmaximized) && !FRAME_OUTPUT_DATA (f)->zoomed_p) | 3034 | else |
| 3026 | lval = Qnil; | 3035 | lval = Qnil; |
| 3027 | 3036 | ||
| 3028 | store_frame_param (f, Qfullscreen, lval); | 3037 | store_frame_param (f, Qfullscreen, lval); |
| @@ -3857,14 +3866,20 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) | |||
| 3857 | case ZOOM_EVENT: | 3866 | case ZOOM_EVENT: |
| 3858 | { | 3867 | { |
| 3859 | struct haiku_zoom_event *b = buf; | 3868 | struct haiku_zoom_event *b = buf; |
| 3860 | |||
| 3861 | struct frame *f = haiku_window_to_frame (b->window); | 3869 | struct frame *f = haiku_window_to_frame (b->window); |
| 3870 | struct haiku_output *output; | ||
| 3862 | 3871 | ||
| 3863 | if (!f) | 3872 | if (!f) |
| 3864 | continue; | 3873 | continue; |
| 3865 | 3874 | ||
| 3866 | FRAME_OUTPUT_DATA (f)->zoomed_p = b->zoomed; | 3875 | output = FRAME_OUTPUT_DATA (f); |
| 3867 | haiku_make_fullscreen_consistent (f); | 3876 | |
| 3877 | if (output->fullscreen_mode == FULLSCREEN_MAXIMIZED) | ||
| 3878 | f->want_fullscreen = FULLSCREEN_NONE; | ||
| 3879 | else | ||
| 3880 | f->want_fullscreen = FULLSCREEN_MAXIMIZED; | ||
| 3881 | |||
| 3882 | FRAME_TERMINAL (f)->fullscreen_hook (f); | ||
| 3868 | break; | 3883 | break; |
| 3869 | } | 3884 | } |
| 3870 | case DRAG_AND_DROP_EVENT: | 3885 | case DRAG_AND_DROP_EVENT: |
| @@ -4096,6 +4111,8 @@ haiku_toggle_invisible_pointer (struct frame *f, bool invisible_p) | |||
| 4096 | static void | 4111 | static void |
| 4097 | haiku_fullscreen (struct frame *f) | 4112 | haiku_fullscreen (struct frame *f) |
| 4098 | { | 4113 | { |
| 4114 | enum haiku_fullscreen_mode mode; | ||
| 4115 | |||
| 4099 | /* When FRAME_OUTPUT_DATA (f)->configury_done is false, the frame is | 4116 | /* When FRAME_OUTPUT_DATA (f)->configury_done is false, the frame is |
| 4100 | being created, and its regular width and height have not yet been | 4117 | being created, and its regular width and height have not yet been |
| 4101 | set. This function will be called again by haiku_create_frame, | 4118 | set. This function will be called again by haiku_create_frame, |
| @@ -4104,18 +4121,22 @@ haiku_fullscreen (struct frame *f) | |||
| 4104 | return; | 4121 | return; |
| 4105 | 4122 | ||
| 4106 | if (f->want_fullscreen == FULLSCREEN_MAXIMIZED) | 4123 | if (f->want_fullscreen == FULLSCREEN_MAXIMIZED) |
| 4107 | BWindow_zoom (FRAME_HAIKU_WINDOW (f)); | 4124 | mode = FULLSCREEN_MODE_MAXIMIZED; |
| 4108 | else if (f->want_fullscreen == FULLSCREEN_BOTH) | 4125 | else if (f->want_fullscreen == FULLSCREEN_BOTH) |
| 4109 | EmacsWindow_make_fullscreen (FRAME_HAIKU_WINDOW (f), 1); | 4126 | mode = FULLSCREEN_MODE_BOTH; |
| 4127 | else if (f->want_fullscreen == FULLSCREEN_WIDTH) | ||
| 4128 | mode = FULLSCREEN_MODE_WIDTH; | ||
| 4129 | else if (f->want_fullscreen == FULLSCREEN_HEIGHT) | ||
| 4130 | mode = FULLSCREEN_MODE_HEIGHT; | ||
| 4110 | else | 4131 | else |
| 4111 | { | 4132 | mode = FULLSCREEN_MODE_NONE; |
| 4112 | EmacsWindow_make_fullscreen (FRAME_HAIKU_WINDOW (f), 0); | ||
| 4113 | EmacsWindow_unzoom (FRAME_HAIKU_WINDOW (f)); | ||
| 4114 | } | ||
| 4115 | 4133 | ||
| 4116 | f->want_fullscreen = FULLSCREEN_NONE; | 4134 | f->want_fullscreen = FULLSCREEN_NONE; |
| 4135 | be_set_window_fullscreen_mode (FRAME_HAIKU_WINDOW (f), mode); | ||
| 4136 | FRAME_OUTPUT_DATA (f)->fullscreen_mode = mode; | ||
| 4117 | 4137 | ||
| 4118 | haiku_update_size_hints (f); | 4138 | haiku_update_size_hints (f); |
| 4139 | haiku_make_fullscreen_consistent (f); | ||
| 4119 | } | 4140 | } |
| 4120 | 4141 | ||
| 4121 | static struct terminal * | 4142 | static struct terminal * |
diff --git a/src/haikuterm.h b/src/haikuterm.h index 068be826871..41b1a85b000 100644 --- a/src/haikuterm.h +++ b/src/haikuterm.h | |||
| @@ -160,13 +160,16 @@ struct haiku_output | |||
| 160 | int fontset; | 160 | int fontset; |
| 161 | int baseline_offset; | 161 | int baseline_offset; |
| 162 | 162 | ||
| 163 | bool_bf zoomed_p : 1; | 163 | /* Whether or not the hourglass cursor is currently being |
| 164 | displayed. */ | ||
| 164 | bool_bf hourglass_p : 1; | 165 | bool_bf hourglass_p : 1; |
| 166 | |||
| 167 | /* Whether or not the menu bar is open. */ | ||
| 165 | bool_bf menu_bar_open_p : 1; | 168 | bool_bf menu_bar_open_p : 1; |
| 166 | 169 | ||
| 167 | /* Whether or not there is data in a back buffer that hasn't been | 170 | /* Whether or not there is data in a back buffer that hasn't been |
| 168 | displayed yet. */ | 171 | displayed yet. */ |
| 169 | bool dirty_p; | 172 | bool_bf dirty_p : 1; |
| 170 | 173 | ||
| 171 | struct font *font; | 174 | struct font *font; |
| 172 | 175 | ||
| @@ -201,6 +204,10 @@ struct haiku_output | |||
| 201 | and top_pos in that the decorator and parent frames are not taken | 204 | and top_pos in that the decorator and parent frames are not taken |
| 202 | into account. */ | 205 | into account. */ |
| 203 | int frame_x, frame_y; | 206 | int frame_x, frame_y; |
| 207 | |||
| 208 | /* The current fullscreen mode of this frame. This should be `enum | ||
| 209 | haiku_fullscreen_mode', but that isn't available here. */ | ||
| 210 | int fullscreen_mode; | ||
| 204 | }; | 211 | }; |
| 205 | 212 | ||
| 206 | struct x_output | 213 | struct x_output |