aboutsummaryrefslogtreecommitdiffstats
path: root/src/haiku_support.cc
diff options
context:
space:
mode:
authorAlan Mackenzie2022-01-22 11:02:50 +0000
committerAlan Mackenzie2022-01-22 11:02:50 +0000
commit14d64a8adcc866deecd758b898e8ef2d836b354a (patch)
tree83cff9669e266f8e283ccb8cd7518e909240f1e1 /src/haiku_support.cc
parentbdd9b5b8a0d37dd09ee530c1dab3a44bee09e0f8 (diff)
parentebe334cdc234de2897263aed4c05ac7088c11857 (diff)
downloademacs-scratch/correct-warning-pos.tar.gz
emacs-scratch/correct-warning-pos.zip
Merge branch 'master' into scratch/correct-warning-posscratch/correct-warning-pos
Diffstat (limited to 'src/haiku_support.cc')
-rw-r--r--src/haiku_support.cc36
1 files changed, 23 insertions, 13 deletions
diff --git a/src/haiku_support.cc b/src/haiku_support.cc
index d49e319b98c..ae2736110ec 100644
--- a/src/haiku_support.cc
+++ b/src/haiku_support.cc
@@ -36,6 +36,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
36#include <interface/MenuBar.h> 36#include <interface/MenuBar.h>
37#include <interface/Alert.h> 37#include <interface/Alert.h>
38#include <interface/Button.h> 38#include <interface/Button.h>
39#include <interface/ControlLook.h>
39 40
40#include <locale/UnicodeChar.h> 41#include <locale/UnicodeChar.h>
41 42
@@ -406,6 +407,7 @@ public:
406 bool menu_bar_active_p = false; 407 bool menu_bar_active_p = false;
407 window_look pre_override_redirect_style; 408 window_look pre_override_redirect_style;
408 window_feel pre_override_redirect_feel; 409 window_feel pre_override_redirect_feel;
410 uint32 pre_override_redirect_workspaces;
409 411
410 EmacsWindow () : BWindow (BRect (0, 0, 0, 0), "", B_TITLED_WINDOW_LOOK, 412 EmacsWindow () : BWindow (BRect (0, 0, 0, 0), "", B_TITLED_WINDOW_LOOK,
411 B_NORMAL_WINDOW_FEEL, B_NO_SERVER_SIDE_WINDOW_MODIFIERS) 413 B_NORMAL_WINDOW_FEEL, B_NO_SERVER_SIDE_WINDOW_MODIFIERS)
@@ -718,6 +720,7 @@ public:
718 int ret; 720 int ret;
719 msg->FindInt32 ("raw_char", &raw); 721 msg->FindInt32 ("raw_char", &raw);
720 msg->FindInt32 ("key", &key); 722 msg->FindInt32 ("key", &key);
723 msg->FindInt64 ("when", &rq.time);
721 724
722 rq.modifiers = 0; 725 rq.modifiers = 0;
723 uint32_t mods = modifiers (); 726 uint32_t mods = modifiers ();
@@ -1318,7 +1321,6 @@ public:
1318 if (!offscreen_draw_view) 1321 if (!offscreen_draw_view)
1319 gui_abort ("Failed to lock offscreen view during buffer flip"); 1322 gui_abort ("Failed to lock offscreen view during buffer flip");
1320 1323
1321 offscreen_draw_view->Flush ();
1322 offscreen_draw_view->Sync (); 1324 offscreen_draw_view->Sync ();
1323 1325
1324 EmacsWindow *w = (EmacsWindow *) Window (); 1326 EmacsWindow *w = (EmacsWindow *) Window ();
@@ -1381,8 +1383,8 @@ public:
1381 rq.just_exited_p = transit == B_EXITED_VIEW; 1383 rq.just_exited_p = transit == B_EXITED_VIEW;
1382 rq.x = point.x; 1384 rq.x = point.x;
1383 rq.y = point.y; 1385 rq.y = point.y;
1384 rq.be_code = transit;
1385 rq.window = this->Window (); 1386 rq.window = this->Window ();
1387 rq.time = system_time ();
1386 1388
1387 if (ToolTip ()) 1389 if (ToolTip ())
1388 ToolTip ()->SetMouseRelativeLocation (BPoint (-(point.x - tt_absl_pos.x), 1390 ToolTip ()->SetMouseRelativeLocation (BPoint (-(point.x - tt_absl_pos.x),
@@ -1437,6 +1439,7 @@ public:
1437 1439
1438 SetMouseEventMask (B_POINTER_EVENTS, B_LOCK_WINDOW_FOCUS); 1440 SetMouseEventMask (B_POINTER_EVENTS, B_LOCK_WINDOW_FOCUS);
1439 1441
1442 rq.time = system_time ();
1440 haiku_write (BUTTON_DOWN, &rq); 1443 haiku_write (BUTTON_DOWN, &rq);
1441 } 1444 }
1442 1445
@@ -1483,6 +1486,7 @@ public:
1483 if (!buttons) 1486 if (!buttons)
1484 SetMouseEventMask (0, 0); 1487 SetMouseEventMask (0, 0);
1485 1488
1489 rq.time = system_time ();
1486 haiku_write (BUTTON_UP, &rq); 1490 haiku_write (BUTTON_UP, &rq);
1487 } 1491 }
1488}; 1492};
@@ -1632,17 +1636,17 @@ public:
1632 { 1636 {
1633 struct haiku_menu_bar_help_event rq; 1637 struct haiku_menu_bar_help_event rq;
1634 1638
1635 if (menu_bar_id >= 0) 1639 if (help)
1640 {
1641 Menu ()->SetToolTip (highlight_p ? help : NULL);
1642 }
1643 else if (menu_bar_id >= 0)
1636 { 1644 {
1637 rq.window = wind_ptr; 1645 rq.window = wind_ptr;
1638 rq.mb_idx = highlight_p ? menu_bar_id : -1; 1646 rq.mb_idx = highlight_p ? menu_bar_id : -1;
1639 1647
1640 haiku_write (MENU_BAR_HELP_EVENT, &rq); 1648 haiku_write (MENU_BAR_HELP_EVENT, &rq);
1641 } 1649 }
1642 else if (help)
1643 {
1644 Menu ()->SetToolTip (highlight_p ? help : NULL);
1645 }
1646 1650
1647 BMenuItem::Highlight (highlight_p); 1651 BMenuItem::Highlight (highlight_p);
1648 } 1652 }
@@ -1997,8 +2001,6 @@ BView_move_frame (void *view, int x, int y, int x1, int y1)
1997 gui_abort ("Failed to lock view moving frame"); 2001 gui_abort ("Failed to lock view moving frame");
1998 vw->MoveTo (x, y); 2002 vw->MoveTo (x, y);
1999 vw->ResizeTo (x1 - x, y1 - y); 2003 vw->ResizeTo (x1 - x, y1 - y);
2000 vw->Flush ();
2001 vw->Sync ();
2002 vw->UnlockLooper (); 2004 vw->UnlockLooper ();
2003} 2005}
2004 2006
@@ -2018,7 +2020,9 @@ BView_scroll_bar_update (void *sb, int portion, int whole, int position)
2018int 2020int
2019BScrollBar_default_size (int horizontal_p) 2021BScrollBar_default_size (int horizontal_p)
2020{ 2022{
2021 return horizontal_p ? B_H_SCROLL_BAR_HEIGHT : B_V_SCROLL_BAR_WIDTH; 2023 return be_control_look->GetScrollBarWidth (horizontal_p
2024 ? B_HORIZONTAL
2025 : B_VERTICAL);
2022} 2026}
2023 2027
2024/* Invalidate VIEW, causing it to be drawn again. */ 2028/* Invalidate VIEW, causing it to be drawn again. */
@@ -2224,7 +2228,11 @@ BWindow_set_tooltip_decoration (void *window)
2224 if (!w->LockLooper ()) 2228 if (!w->LockLooper ())
2225 gui_abort ("Failed to lock window while setting ttip decoration"); 2229 gui_abort ("Failed to lock window while setting ttip decoration");
2226 w->SetLook (B_BORDERED_WINDOW_LOOK); 2230 w->SetLook (B_BORDERED_WINDOW_LOOK);
2227 w->SetFeel (B_FLOATING_APP_WINDOW_FEEL); 2231 w->SetFeel (kMenuWindowFeel);
2232 w->SetFlags (B_NOT_ZOOMABLE
2233 | B_NOT_MINIMIZABLE
2234 | B_AVOID_FRONT
2235 | B_AVOID_FOCUS);
2228 w->UnlockLooper (); 2236 w->UnlockLooper ();
2229} 2237}
2230 2238
@@ -2241,7 +2249,6 @@ BWindow_set_avoid_focus (void *window, int avoid_focus_p)
2241 w->SetFlags (w->Flags () & ~B_AVOID_FOCUS); 2249 w->SetFlags (w->Flags () & ~B_AVOID_FOCUS);
2242 else 2250 else
2243 w->SetFlags (w->Flags () | B_AVOID_FOCUS); 2251 w->SetFlags (w->Flags () | B_AVOID_FOCUS);
2244 w->Sync ();
2245 w->UnlockLooper (); 2252 w->UnlockLooper ();
2246} 2253}
2247 2254
@@ -2818,7 +2825,7 @@ be_popup_file_dialog (int open_p, const char *default_dir, int must_match_p, int
2818 enum haiku_event_type type; 2825 enum haiku_event_type type;
2819 char *ptr = NULL; 2826 char *ptr = NULL;
2820 2827
2821 if (!haiku_read_with_timeout (&type, buf, 200, 100000)) 2828 if (!haiku_read_with_timeout (&type, buf, 200, 1000000))
2822 { 2829 {
2823 block_input_function (); 2830 block_input_function ();
2824 if (type != FILE_PANEL_EVENT) 2831 if (type != FILE_PANEL_EVENT)
@@ -3166,11 +3173,14 @@ BWindow_set_override_redirect (void *window, bool override_redirect_p)
3166 w->pre_override_redirect_style = w->Look (); 3173 w->pre_override_redirect_style = w->Look ();
3167 w->SetFeel (kMenuWindowFeel); 3174 w->SetFeel (kMenuWindowFeel);
3168 w->SetLook (B_NO_BORDER_WINDOW_LOOK); 3175 w->SetLook (B_NO_BORDER_WINDOW_LOOK);
3176 w->pre_override_redirect_workspaces = w->Workspaces ();
3177 w->SetWorkspaces (B_ALL_WORKSPACES);
3169 } 3178 }
3170 else 3179 else
3171 { 3180 {
3172 w->SetFeel (w->pre_override_redirect_feel); 3181 w->SetFeel (w->pre_override_redirect_feel);
3173 w->SetLook (w->pre_override_redirect_style); 3182 w->SetLook (w->pre_override_redirect_style);
3183 w->SetWorkspaces (w->pre_override_redirect_workspaces);
3174 } 3184 }
3175 3185
3176 w->UnlockLooper (); 3186 w->UnlockLooper ();