mac: Add app.dock.hide()/show() APIs, closes #422.
This commit is contained in:
parent
3eecd664b4
commit
8ecc4061a8
5 changed files with 39 additions and 1 deletions
|
@ -4,9 +4,11 @@
|
|||
|
||||
#include "atom/browser/browser.h"
|
||||
|
||||
#import "atom/browser/mac/atom_application.h"
|
||||
#include "atom/browser/native_window.h"
|
||||
#include "atom/browser/window_list.h"
|
||||
#import "base/mac/bundle_locations.h"
|
||||
#include "base/strings/sys_string_conversions.h"
|
||||
#import "atom/browser/mac/atom_application.h"
|
||||
|
||||
namespace atom {
|
||||
|
||||
|
@ -44,4 +46,18 @@ std::string Browser::DockGetBadgeText() {
|
|||
return base::SysNSStringToUTF8([tile badgeLabel]);
|
||||
}
|
||||
|
||||
void Browser::DockHide() {
|
||||
WindowList* list = WindowList::GetInstance();
|
||||
for (WindowList::iterator it = list->begin(); it != list->end(); ++it)
|
||||
[(*it)->GetNativeWindow() setCanHide:NO];
|
||||
|
||||
ProcessSerialNumber psn = { 0, kCurrentProcess };
|
||||
TransformProcessType(&psn, kProcessTransformToUIElementApplication);
|
||||
}
|
||||
|
||||
void Browser::DockShow() {
|
||||
ProcessSerialNumber psn = { 0, kCurrentProcess };
|
||||
TransformProcessType(&psn, kProcessTransformToForegroundApplication);
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue