File tree Expand file tree Collapse file tree 4 files changed +36
-12
lines changed
Expand file tree Collapse file tree 4 files changed +36
-12
lines changed Original file line number Diff line number Diff line change 44
55namespace nativeapi {
66
7- AccessibilityManager::AccessibilityManager () {
8- std::cout << " AccessibilityManager::AccessibilityManager()" << std::endl;
9- };
7+ AccessibilityManager::AccessibilityManager () {}
108
11- AccessibilityManager::~AccessibilityManager () {
12- std::cout << " AccessibilityManager::~AccessibilityManager()" << std::endl;
13- };
9+ AccessibilityManager::~AccessibilityManager () {}
1410
1511} // namespace nativeapi
Original file line number Diff line number Diff line change 44
55namespace nativeapi {
66
7- BroadcastCenter::BroadcastCenter () {
8- std::cout << " BroadcastCenter::BroadcastCenter()" << std::endl;
9- };
7+ BroadcastCenter::BroadcastCenter () {}
108
11- BroadcastCenter::~BroadcastCenter () {
12- std::cout << " BroadcastCenter::~BroadcastCenter()" << std::endl;
13- };
9+ BroadcastCenter::~BroadcastCenter () {}
1410
1511BroadcastEventHandler::BroadcastEventHandler (
1612 std::function<void (const std::string& topic, const std::string& message)>
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ class Window {
1818 void Blur ();
1919 bool IsFocused () const ;
2020 void Show ();
21+ void ShowInactive ();
2122 void Hide ();
2223 bool IsVisible () const ;
2324 void Maximize ();
@@ -62,6 +63,10 @@ class Window {
6263 bool HasShadow () const ;
6364 void SetOpacity (float opacity);
6465 float GetOpacity () const ;
66+ void SetVisibleOnAllWorkspaces (bool is_visible_on_all_workspaces);
67+ bool IsVisibleOnAllWorkspaces () const ;
68+ void SetIgnoreMouseEvents (bool is_ignore_mouse_events);
69+ bool IsIgnoreMouseEvents () const ;
6570 void SetFocusable (bool is_focusable);
6671 bool IsFocusable () const ;
6772 void StartDragging ();
Original file line number Diff line number Diff line change 3939}
4040
4141void Window::Show () {
42+ [pimpl_->ns_window_ setIsVisible: YES ];
43+ // Panels receive key focus when shown but should not activate the app.
44+ if (![pimpl_->ns_window_ isKindOfClass: [NSPanel class ]]) {
45+ [[NSApplication sharedApplication ] activateIgnoringOtherApps: YES ];
46+ }
47+ [pimpl_->ns_window_ makeKeyAndOrderFront: nil ];
48+ }
49+
50+ void Window::ShowInactive () {
4251 [pimpl_->ns_window_ setIsVisible: YES ];
4352 [pimpl_->ns_window_ orderFrontRegardless ];
4453}
282291 return [pimpl_->ns_window_ alphaValue ];
283292}
284293
294+ void Window::SetVisibleOnAllWorkspaces (bool is_visible_on_all_workspaces) {
295+ [pimpl_->ns_window_ setCollectionBehavior: is_visible_on_all_workspaces
296+ ? NSWindowCollectionBehaviorCanJoinAllSpaces
297+ : NSWindowCollectionBehaviorDefault];
298+ }
299+
300+ bool Window::IsVisibleOnAllWorkspaces () const {
301+ return [pimpl_->ns_window_ collectionBehavior ] & NSWindowCollectionBehaviorCanJoinAllSpaces;
302+ }
303+
304+ void Window::SetIgnoreMouseEvents (bool is_ignore_mouse_events) {
305+ [pimpl_->ns_window_ setIgnoresMouseEvents: is_ignore_mouse_events];
306+ }
307+
308+ bool Window::IsIgnoreMouseEvents () const {
309+ return [pimpl_->ns_window_ ignoresMouseEvents ];
310+ }
311+
285312void Window::SetFocusable (bool is_focusable) {
286313 // TODO: Implement this
287314}
You can’t perform that action at this time.
0 commit comments