mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-06 08:21:42 +08:00
[v3] Fix systray example. PositionWindow now takes an offset. EventApplicationDidResignActive
-> EventApplicationDidResignActiveNotification
This commit is contained in:
parent
16ce9e562f
commit
3d323ab9d2
@ -2,7 +2,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
_ "embed"
|
_ "embed"
|
||||||
"fmt"
|
"github.com/wailsapp/wails/v3/pkg/events"
|
||||||
"github.com/wailsapp/wails/v3/pkg/icons"
|
"github.com/wailsapp/wails/v3/pkg/icons"
|
||||||
"log"
|
"log"
|
||||||
"runtime"
|
"runtime"
|
||||||
@ -10,13 +10,6 @@ import (
|
|||||||
"github.com/wailsapp/wails/v3/pkg/application"
|
"github.com/wailsapp/wails/v3/pkg/application"
|
||||||
)
|
)
|
||||||
|
|
||||||
var counter int
|
|
||||||
|
|
||||||
func clickCount() int {
|
|
||||||
counter++
|
|
||||||
return counter
|
|
||||||
}
|
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
app := application.New(application.Options{
|
app := application.New(application.Options{
|
||||||
Name: "Systray Demo",
|
Name: "Systray Demo",
|
||||||
@ -27,10 +20,23 @@ func main() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
window := app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
|
window := app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
|
||||||
Width: 500,
|
Width: 500,
|
||||||
Height: 800,
|
Height: 800,
|
||||||
//Frameless: true,
|
Frameless: true,
|
||||||
Hidden: true,
|
AlwaysOnTop: true,
|
||||||
|
Hidden: true,
|
||||||
|
ShouldClose: func(window *application.WebviewWindow) bool {
|
||||||
|
window.Hide()
|
||||||
|
return false
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
window.On(events.Common.WindowLostFocus, func(ctx *application.WindowEventContext) {
|
||||||
|
window.Hide()
|
||||||
|
})
|
||||||
|
|
||||||
|
app.On(events.Mac.ApplicationDidResignActiveNotification, func() {
|
||||||
|
window.Hide()
|
||||||
})
|
})
|
||||||
|
|
||||||
systemTray := app.NewSystemTray()
|
systemTray := app.NewSystemTray()
|
||||||
@ -73,8 +79,11 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
showWindow := func() {
|
showWindow := func() {
|
||||||
window.SetTitle(fmt.Sprintf("Clicked %d times", clickCount()))
|
if window.IsVisible() {
|
||||||
err := systemTray.PositionWindow(window)
|
window.Hide()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err := systemTray.PositionWindow(window, 5)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
application.InfoDialog().SetTitle("Error").SetMessage(err.Error()).Show()
|
application.InfoDialog().SetTitle("Error").SetMessage(err.Error()).Show()
|
||||||
return
|
return
|
||||||
|
@ -20,7 +20,7 @@ export const EventTypes = {
|
|||||||
ApplicationDidChangeStatusBarOrientation: "mac:ApplicationDidChangeStatusBarOrientation",
|
ApplicationDidChangeStatusBarOrientation: "mac:ApplicationDidChangeStatusBarOrientation",
|
||||||
ApplicationDidFinishLaunching: "mac:ApplicationDidFinishLaunching",
|
ApplicationDidFinishLaunching: "mac:ApplicationDidFinishLaunching",
|
||||||
ApplicationDidHide: "mac:ApplicationDidHide",
|
ApplicationDidHide: "mac:ApplicationDidHide",
|
||||||
ApplicationDidResignActive: "mac:ApplicationDidResignActive",
|
ApplicationDidResignActiveNotification: "mac:ApplicationDidResignActiveNotification",
|
||||||
ApplicationDidUnhide: "mac:ApplicationDidUnhide",
|
ApplicationDidUnhide: "mac:ApplicationDidUnhide",
|
||||||
ApplicationDidUpdate: "mac:ApplicationDidUpdate",
|
ApplicationDidUpdate: "mac:ApplicationDidUpdate",
|
||||||
ApplicationWillBecomeActive: "mac:ApplicationWillBecomeActive",
|
ApplicationWillBecomeActive: "mac:ApplicationWillBecomeActive",
|
||||||
@ -66,7 +66,6 @@ export const EventTypes = {
|
|||||||
WindowDidResignKey: "mac:WindowDidResignKey",
|
WindowDidResignKey: "mac:WindowDidResignKey",
|
||||||
WindowDidResignMain: "mac:WindowDidResignMain",
|
WindowDidResignMain: "mac:WindowDidResignMain",
|
||||||
WindowDidResize: "mac:WindowDidResize",
|
WindowDidResize: "mac:WindowDidResize",
|
||||||
WindowDidUnfocus: "mac:WindowDidUnfocus",
|
|
||||||
WindowDidUpdate: "mac:WindowDidUpdate",
|
WindowDidUpdate: "mac:WindowDidUpdate",
|
||||||
WindowDidUpdateAlpha: "mac:WindowDidUpdateAlpha",
|
WindowDidUpdateAlpha: "mac:WindowDidUpdateAlpha",
|
||||||
WindowDidUpdateCollectionBehavior: "mac:WindowDidUpdateCollectionBehavior",
|
WindowDidUpdateCollectionBehavior: "mac:WindowDidUpdateCollectionBehavior",
|
||||||
@ -145,7 +144,7 @@ export const EventTypes = {
|
|||||||
ApplicationDidChangeStatusBarOrientation: "mac:ApplicationDidChangeStatusBarOrientation",
|
ApplicationDidChangeStatusBarOrientation: "mac:ApplicationDidChangeStatusBarOrientation",
|
||||||
ApplicationDidFinishLaunching: "mac:ApplicationDidFinishLaunching",
|
ApplicationDidFinishLaunching: "mac:ApplicationDidFinishLaunching",
|
||||||
ApplicationDidHide: "mac:ApplicationDidHide",
|
ApplicationDidHide: "mac:ApplicationDidHide",
|
||||||
ApplicationDidResignActive: "mac:ApplicationDidResignActive",
|
ApplicationDidResignActiveNotification: "mac:ApplicationDidResignActiveNotification",
|
||||||
ApplicationDidUnhide: "mac:ApplicationDidUnhide",
|
ApplicationDidUnhide: "mac:ApplicationDidUnhide",
|
||||||
ApplicationDidUpdate: "mac:ApplicationDidUpdate",
|
ApplicationDidUpdate: "mac:ApplicationDidUpdate",
|
||||||
ApplicationWillBecomeActive: "mac:ApplicationWillBecomeActive",
|
ApplicationWillBecomeActive: "mac:ApplicationWillBecomeActive",
|
||||||
@ -191,7 +190,6 @@ export const EventTypes = {
|
|||||||
WindowDidResignKey: "mac:WindowDidResignKey",
|
WindowDidResignKey: "mac:WindowDidResignKey",
|
||||||
WindowDidResignMain: "mac:WindowDidResignMain",
|
WindowDidResignMain: "mac:WindowDidResignMain",
|
||||||
WindowDidResize: "mac:WindowDidResize",
|
WindowDidResize: "mac:WindowDidResize",
|
||||||
WindowDidUnfocus: "mac:WindowDidUnfocus",
|
|
||||||
WindowDidUpdate: "mac:WindowDidUpdate",
|
WindowDidUpdate: "mac:WindowDidUpdate",
|
||||||
WindowDidUpdateAlpha: "mac:WindowDidUpdateAlpha",
|
WindowDidUpdateAlpha: "mac:WindowDidUpdateAlpha",
|
||||||
WindowDidUpdateCollectionBehavior: "mac:WindowDidUpdateCollectionBehavior",
|
WindowDidUpdateCollectionBehavior: "mac:WindowDidUpdateCollectionBehavior",
|
||||||
@ -279,7 +277,7 @@ export const EventTypes = {
|
|||||||
WindowZoomOut: "common:WindowZoomOut",
|
WindowZoomOut: "common:WindowZoomOut",
|
||||||
WindowZoomReset: "common:WindowZoomReset",
|
WindowZoomReset: "common:WindowZoomReset",
|
||||||
WindowFocus: "common:WindowFocus",
|
WindowFocus: "common:WindowFocus",
|
||||||
WindowUnFocus: "common:WindowUnFocus",
|
WindowLostFocus: "common:WindowLostFocus",
|
||||||
WindowShow: "common:WindowShow",
|
WindowShow: "common:WindowShow",
|
||||||
WindowHide: "common:WindowHide",
|
WindowHide: "common:WindowHide",
|
||||||
WindowDPIChanged: "common:WindowDPIChanged",
|
WindowDPIChanged: "common:WindowDPIChanged",
|
||||||
|
@ -73,9 +73,9 @@ extern bool hasListeners(unsigned int);
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)applicationDidResignActive:(NSNotification *)notification {
|
- (void)applicationDidResignActiveNotification:(NSNotification *)notification {
|
||||||
if( hasListeners(EventApplicationDidResignActive) ) {
|
if( hasListeners(EventApplicationDidResignActiveNotification) ) {
|
||||||
processApplicationEvent(EventApplicationDidResignActive);
|
processApplicationEvent(EventApplicationDidResignActiveNotification);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,11 @@ type systemTrayImpl interface {
|
|||||||
setDarkModeIcon(icon []byte)
|
setDarkModeIcon(icon []byte)
|
||||||
bounds() (*Rect, error)
|
bounds() (*Rect, error)
|
||||||
getScreen() (*Screen, error)
|
getScreen() (*Screen, error)
|
||||||
positionWindow(window *WebviewWindow) error
|
positionWindow(window *WebviewWindow, offset int) error
|
||||||
|
}
|
||||||
|
|
||||||
|
type PositionOptions struct {
|
||||||
|
Buffer int
|
||||||
}
|
}
|
||||||
|
|
||||||
type SystemTray struct {
|
type SystemTray struct {
|
||||||
@ -81,12 +85,12 @@ func (s *SystemTray) run() {
|
|||||||
invokeSync(s.impl.run)
|
invokeSync(s.impl.run)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *SystemTray) PositionWindow(window *WebviewWindow) error {
|
func (s *SystemTray) PositionWindow(window *WebviewWindow, offset int) error {
|
||||||
if s.impl == nil {
|
if s.impl == nil {
|
||||||
return fmt.Errorf("system tray not running")
|
return fmt.Errorf("system tray not running")
|
||||||
}
|
}
|
||||||
return invokeSyncWithError(func() error {
|
return invokeSyncWithError(func() error {
|
||||||
return s.impl.positionWindow(window)
|
return s.impl.positionWindow(window, offset)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ func (s *macosSystemTray) setMenu(menu *Menu) {
|
|||||||
s.menu = menu
|
s.menu = menu
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *macosSystemTray) positionWindow(window *WebviewWindow) error {
|
func (s *macosSystemTray) positionWindow(window *WebviewWindow, offset int) error {
|
||||||
|
|
||||||
// Get the trayBounds of this system tray
|
// Get the trayBounds of this system tray
|
||||||
trayBounds, err := s.bounds()
|
trayBounds, err := s.bounds()
|
||||||
@ -70,61 +70,23 @@ func (s *macosSystemTray) positionWindow(window *WebviewWindow) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
screenBounds := currentScreen.Bounds
|
screenBounds := currentScreen.Bounds
|
||||||
|
|
||||||
// Determine which quadrant of the screen the system tray is in
|
|
||||||
// ----------
|
|
||||||
// | 1 | 2 |
|
|
||||||
// ----------
|
|
||||||
// | 3 | 4 |
|
|
||||||
// ----------
|
|
||||||
quadrant := 4
|
|
||||||
if trayBounds.X < screenBounds.Width/2 {
|
|
||||||
quadrant -= 1
|
|
||||||
}
|
|
||||||
if trayBounds.Y < screenBounds.Height/2 {
|
|
||||||
quadrant -= 2
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the center height of the window
|
// Get the center height of the window
|
||||||
windowWidthCenter := window.Width() / 2
|
windowWidthCenter := window.Width() / 2
|
||||||
|
|
||||||
// Get the center height of the system tray
|
// Get the center height of the system tray
|
||||||
systemTrayWidthCenter := trayBounds.Width / 2
|
systemTrayWidthCenter := trayBounds.Width / 2
|
||||||
|
|
||||||
// Position the window based on the quadrant
|
// The Y will be 0 and the X will make the center of the window line up with the center of the system tray
|
||||||
// It will be centered on the system tray and if it goes off-screen it will be moved back on screen
|
windowX := trayBounds.X + systemTrayWidthCenter - windowWidthCenter
|
||||||
switch quadrant {
|
|
||||||
case 1:
|
// If the end of the window goes off-screen, move it back enough to be on screen
|
||||||
// The X will be 0 and the Y will be the system tray Y
|
if windowX+window.Width() > screenBounds.Width {
|
||||||
// Center the window on the system tray
|
windowX = screenBounds.Width - window.Width()
|
||||||
window.SetRelativePosition(0, trayBounds.Y)
|
|
||||||
case 2:
|
|
||||||
// The Y will be 0 and the X will make the center of the window line up with the center of the system tray
|
|
||||||
windowX := trayBounds.X + systemTrayWidthCenter - windowWidthCenter
|
|
||||||
// If the end of the window goes off-screen, move it back enough to be on screen
|
|
||||||
if windowX+window.Width() > screenBounds.Width {
|
|
||||||
windowX = screenBounds.Width - window.Width()
|
|
||||||
}
|
|
||||||
window.SetRelativePosition(windowX, 0)
|
|
||||||
case 3:
|
|
||||||
// The X will be 0 and the Y will be the system tray Y - the height of the window
|
|
||||||
windowY := trayBounds.Y - window.Height()
|
|
||||||
// If the end of the window goes off-screen, move it back enough to be on screen
|
|
||||||
if windowY < 0 {
|
|
||||||
windowY = 0
|
|
||||||
}
|
|
||||||
window.SetRelativePosition(0, windowY)
|
|
||||||
case 4:
|
|
||||||
// The Y will be 0 and the X will make the center of the window line up with the center of the system tray - the height of the window
|
|
||||||
windowX := trayBounds.X + systemTrayWidthCenter - windowWidthCenter
|
|
||||||
windowY := trayBounds.Y - window.Height()
|
|
||||||
// If the end of the window goes off-screen, move it back enough to be on screen
|
|
||||||
if windowX+window.Width() > screenBounds.Width {
|
|
||||||
windowX = screenBounds.Width - window.Width()
|
|
||||||
}
|
|
||||||
window.SetRelativePosition(windowX, windowY)
|
|
||||||
}
|
}
|
||||||
|
window.SetRelativePosition(windowX, int(C.statusBarHeight())+offset)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,4 +12,5 @@ void systemTraySetIcon(void* nsStatusItem, void* nsImage, int position, bool isT
|
|||||||
void systemTraySetMenu(void* nsStatusItem, void* nsMenu);
|
void systemTraySetMenu(void* nsStatusItem, void* nsMenu);
|
||||||
void systemTrayDestroy(void* nsStatusItem);
|
void systemTrayDestroy(void* nsStatusItem);
|
||||||
void showMenu(void* nsStatusItem);
|
void showMenu(void* nsStatusItem);
|
||||||
void systemTrayGetBounds(void* nsStatusItem, NSRect *rect);
|
void systemTrayGetBounds(void* nsStatusItem, NSRect *rect);
|
||||||
|
int statusBarHeight();
|
@ -105,4 +105,10 @@ void systemTrayGetBounds(void* nsStatusItem, NSRect *rect) {
|
|||||||
NSStatusItem *statusItem = (NSStatusItem *)nsStatusItem;
|
NSStatusItem *statusItem = (NSStatusItem *)nsStatusItem;
|
||||||
NSRect buttonFrame = statusItem.button.frame;
|
NSRect buttonFrame = statusItem.button.frame;
|
||||||
*rect = [statusItem.button.window convertRectToScreen:buttonFrame];
|
*rect = [statusItem.button.window convertRectToScreen:buttonFrame];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int statusBarHeight() {
|
||||||
|
NSMenu *mainMenu = [NSApp mainMenu];
|
||||||
|
CGFloat menuBarHeight = [mainMenu menuBarHeight];
|
||||||
|
return (int)menuBarHeight;
|
||||||
|
}
|
||||||
|
@ -30,7 +30,7 @@ type windowsSystemTray struct {
|
|||||||
currentIcon w32.HICON
|
currentIcon w32.HICON
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *windowsSystemTray) positionWindow(window *WebviewWindow) error {
|
func (s *windowsSystemTray) positionWindow(window *WebviewWindow, offset int) error {
|
||||||
|
|
||||||
// Get the trayBounds of this system tray
|
// Get the trayBounds of this system tray
|
||||||
trayBounds, err := s.bounds()
|
trayBounds, err := s.bounds()
|
||||||
@ -51,7 +51,7 @@ func (s *windowsSystemTray) positionWindow(window *WebviewWindow) error {
|
|||||||
case w32.ABE_LEFT:
|
case w32.ABE_LEFT:
|
||||||
if trayBounds == nil {
|
if trayBounds == nil {
|
||||||
// Move it to the bottom left corner of the screen
|
// Move it to the bottom left corner of the screen
|
||||||
window.SetRelativePosition(0, screenBounds.Height-window.Height())
|
window.SetRelativePosition(offset, screenBounds.Height-window.Height())
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
newHeight := trayBounds.Y - (window.Height() / 2)
|
newHeight := trayBounds.Y - (window.Height() / 2)
|
||||||
@ -59,11 +59,11 @@ func (s *windowsSystemTray) positionWindow(window *WebviewWindow) error {
|
|||||||
newHeight = 0
|
newHeight = 0
|
||||||
}
|
}
|
||||||
// Move it to the top left corner of the screen
|
// Move it to the top left corner of the screen
|
||||||
window.SetRelativePosition(0, newHeight)
|
window.SetRelativePosition(offset, newHeight)
|
||||||
case w32.ABE_TOP:
|
case w32.ABE_TOP:
|
||||||
if trayBounds == nil {
|
if trayBounds == nil {
|
||||||
// Move it to the top right corner of the screen
|
// Move it to the top right corner of the screen
|
||||||
window.SetRelativePosition(screenBounds.Width-window.Width(), 0)
|
window.SetRelativePosition(screenBounds.Width-window.Width(), offset)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
newWidth := trayBounds.X - (window.Width() / 2)
|
newWidth := trayBounds.X - (window.Width() / 2)
|
||||||
@ -71,29 +71,29 @@ func (s *windowsSystemTray) positionWindow(window *WebviewWindow) error {
|
|||||||
newWidth = screenBounds.Width - window.Width()
|
newWidth = screenBounds.Width - window.Width()
|
||||||
}
|
}
|
||||||
// Move it to the top left corner of the screen
|
// Move it to the top left corner of the screen
|
||||||
window.SetRelativePosition(newWidth, 0)
|
window.SetRelativePosition(newWidth, offset)
|
||||||
case w32.ABE_RIGHT:
|
case w32.ABE_RIGHT:
|
||||||
if trayBounds == nil {
|
if trayBounds == nil {
|
||||||
// Move it to the bottom right corner of the screen
|
// Move it to the bottom right corner of the screen
|
||||||
window.SetRelativePosition(screenBounds.Width-window.Width(), screenBounds.Height-window.Height())
|
window.SetRelativePosition(screenBounds.Width-window.Width()-offset, screenBounds.Height-window.Height())
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
newHeight := trayBounds.Y - (window.Height() / 2)
|
newHeight := trayBounds.Y - (window.Height() / 2)
|
||||||
if newHeight > screenBounds.Height-window.Height() {
|
if newHeight > screenBounds.Height-window.Height() {
|
||||||
newHeight = screenBounds.Height - window.Height()
|
newHeight = screenBounds.Height - window.Height()
|
||||||
}
|
}
|
||||||
window.SetRelativePosition(screenBounds.Width-window.Width(), newHeight)
|
window.SetRelativePosition(screenBounds.Width-window.Width()-offset, newHeight)
|
||||||
case w32.ABE_BOTTOM:
|
case w32.ABE_BOTTOM:
|
||||||
if trayBounds == nil {
|
if trayBounds == nil {
|
||||||
// Move it to the bottom right corner of the screen
|
// Move it to the bottom right corner of the screen
|
||||||
window.SetRelativePosition(screenBounds.Width-window.Width(), screenBounds.Height-window.Height())
|
window.SetRelativePosition(screenBounds.Width-window.Width(), screenBounds.Height-window.Height()-offset)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
newWidth := trayBounds.X - (window.Width() / 2)
|
newWidth := trayBounds.X - (window.Width() / 2)
|
||||||
if newWidth > screenBounds.Width-window.Width() {
|
if newWidth > screenBounds.Width-window.Width() {
|
||||||
newWidth = screenBounds.Width - window.Width()
|
newWidth = screenBounds.Width - window.Width()
|
||||||
}
|
}
|
||||||
window.SetRelativePosition(newWidth, screenBounds.Height-window.Height())
|
window.SetRelativePosition(newWidth, screenBounds.Height-window.Height()-offset)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -689,6 +689,16 @@ void windowSetEnabled(void *window, bool enabled) {
|
|||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void windowFocus(void *window) {
|
||||||
|
WebviewWindow* nsWindow = (WebviewWindow*)window;
|
||||||
|
// If the current application is not active, activate it
|
||||||
|
if (![[NSApplication sharedApplication] isActive]) {
|
||||||
|
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
|
||||||
|
}
|
||||||
|
[nsWindow makeKeyAndOrderFront:nil];
|
||||||
|
[nsWindow makeKeyWindow];
|
||||||
|
}
|
||||||
|
|
||||||
*/
|
*/
|
||||||
import "C"
|
import "C"
|
||||||
import (
|
import (
|
||||||
@ -721,7 +731,8 @@ func (w *macosWebviewWindow) startResize(_ string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (w *macosWebviewWindow) focus() {
|
func (w *macosWebviewWindow) focus() {
|
||||||
w.show()
|
// Make the window key and main
|
||||||
|
C.windowFocus(w.nsWindow)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *macosWebviewWindow) openContextMenu(menu *Menu, data *ContextMenuData) {
|
func (w *macosWebviewWindow) openContextMenu(menu *Menu, data *ContextMenuData) {
|
||||||
@ -1075,9 +1086,12 @@ func (w *macosWebviewWindow) run() {
|
|||||||
w.parent.emit(events.Common.WindowClosing)
|
w.parent.emit(events.Common.WindowClosing)
|
||||||
})
|
})
|
||||||
|
|
||||||
// Translate WindowDidUnfocus to common WindowUnFocus event
|
// Translate WindowDidResignKey to common WindowLostFocus event
|
||||||
w.parent.On(events.Mac.WindowDidUnfocus, func(_ *WindowEventContext) {
|
w.parent.On(events.Mac.WindowDidResignKey, func(_ *WindowEventContext) {
|
||||||
w.parent.emit(events.Common.WindowUnFocus)
|
w.parent.emit(events.Common.WindowLostFocus)
|
||||||
|
})
|
||||||
|
w.parent.On(events.Mac.WindowDidResignMain, func(_ *WindowEventContext) {
|
||||||
|
w.parent.emit(events.Common.WindowLostFocus)
|
||||||
})
|
})
|
||||||
|
|
||||||
if w.parent.options.HTML != "" {
|
if w.parent.options.HTML != "" {
|
||||||
|
@ -57,18 +57,15 @@ extern bool hasListeners(unsigned int);
|
|||||||
self.leftMouseEvent = nil;
|
self.leftMouseEvent = nil;
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) startDrag:(WebviewWindow*)window {
|
- (void) startDrag:(WebviewWindow*)window {
|
||||||
[window performWindowDragWithEvent:self.leftMouseEvent];
|
[window performWindowDragWithEvent:self.leftMouseEvent];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle script messages from the external bridge
|
// Handle script messages from the external bridge
|
||||||
- (void)userContentController:(nonnull WKUserContentController *)userContentController didReceiveScriptMessage:(nonnull WKScriptMessage *)message {
|
- (void)userContentController:(nonnull WKUserContentController *)userContentController didReceiveScriptMessage:(nonnull WKScriptMessage *)message {
|
||||||
NSString *m = message.body;
|
NSString *m = message.body;
|
||||||
const char *_m = [m UTF8String];
|
const char *_m = [m UTF8String];
|
||||||
processMessage(self.windowId, _m);
|
processMessage(self.windowId, _m);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)handleLeftMouseDown:(NSEvent *)event {
|
- (void)handleLeftMouseDown:(NSEvent *)event {
|
||||||
self.leftMouseEvent = event;
|
self.leftMouseEvent = event;
|
||||||
NSWindow *window = [event window];
|
NSWindow *window = [event window];
|
||||||
@ -314,12 +311,6 @@ extern bool hasListeners(unsigned int);
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)windowDidUnfocus:(NSNotification *)notification {
|
|
||||||
if( hasListeners(EventWindowDidUnfocus) ) {
|
|
||||||
processWindowEvent(self.windowId, EventWindowDidUnfocus);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)windowDidUpdate:(NSNotification *)notification {
|
- (void)windowDidUpdate:(NSNotification *)notification {
|
||||||
if( hasListeners(EventWindowDidUpdate) ) {
|
if( hasListeners(EventWindowDidUpdate) ) {
|
||||||
processWindowEvent(self.windowId, EventWindowDidUpdate);
|
processWindowEvent(self.windowId, EventWindowDidUpdate);
|
||||||
|
@ -751,7 +751,7 @@ func (w *windowsWebviewWindow) WndProc(msg uint32, wparam, lparam uintptr) uintp
|
|||||||
w.parent.emit(events.Common.WindowClosing)
|
w.parent.emit(events.Common.WindowClosing)
|
||||||
return 0
|
return 0
|
||||||
case w32.WM_KILLFOCUS:
|
case w32.WM_KILLFOCUS:
|
||||||
w.parent.emit(events.Common.WindowUnFocus)
|
w.parent.emit(events.Common.WindowLostFocus)
|
||||||
case w32.WM_SETFOCUS:
|
case w32.WM_SETFOCUS:
|
||||||
w.parent.emit(events.Common.WindowFocus)
|
w.parent.emit(events.Common.WindowFocus)
|
||||||
case w32.WM_NCLBUTTONDOWN:
|
case w32.WM_NCLBUTTONDOWN:
|
||||||
|
@ -24,7 +24,7 @@ type commonEvents struct {
|
|||||||
WindowZoomOut WindowEventType
|
WindowZoomOut WindowEventType
|
||||||
WindowZoomReset WindowEventType
|
WindowZoomReset WindowEventType
|
||||||
WindowFocus WindowEventType
|
WindowFocus WindowEventType
|
||||||
WindowUnFocus WindowEventType
|
WindowLostFocus WindowEventType
|
||||||
WindowShow WindowEventType
|
WindowShow WindowEventType
|
||||||
WindowHide WindowEventType
|
WindowHide WindowEventType
|
||||||
WindowDPIChanged WindowEventType
|
WindowDPIChanged WindowEventType
|
||||||
@ -32,24 +32,24 @@ type commonEvents struct {
|
|||||||
|
|
||||||
func newCommonEvents() commonEvents {
|
func newCommonEvents() commonEvents {
|
||||||
return commonEvents{
|
return commonEvents{
|
||||||
ApplicationStarted: 1154,
|
ApplicationStarted: 1153,
|
||||||
WindowMaximise: 1155,
|
WindowMaximise: 1154,
|
||||||
WindowUnMaximise: 1156,
|
WindowUnMaximise: 1155,
|
||||||
WindowFullscreen: 1157,
|
WindowFullscreen: 1156,
|
||||||
WindowUnFullscreen: 1158,
|
WindowUnFullscreen: 1157,
|
||||||
WindowRestore: 1159,
|
WindowRestore: 1158,
|
||||||
WindowMinimise: 1160,
|
WindowMinimise: 1159,
|
||||||
WindowUnMinimise: 1161,
|
WindowUnMinimise: 1160,
|
||||||
WindowClosing: 1162,
|
WindowClosing: 1161,
|
||||||
WindowZoom: 1163,
|
WindowZoom: 1162,
|
||||||
WindowZoomIn: 1164,
|
WindowZoomIn: 1163,
|
||||||
WindowZoomOut: 1165,
|
WindowZoomOut: 1164,
|
||||||
WindowZoomReset: 1166,
|
WindowZoomReset: 1165,
|
||||||
WindowFocus: 1167,
|
WindowFocus: 1166,
|
||||||
WindowUnFocus: 1168,
|
WindowLostFocus: 1167,
|
||||||
WindowShow: 1169,
|
WindowShow: 1168,
|
||||||
WindowHide: 1170,
|
WindowHide: 1169,
|
||||||
WindowDPIChanged: 1171,
|
WindowDPIChanged: 1170,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ type macEvents struct {
|
|||||||
ApplicationDidChangeStatusBarOrientation ApplicationEventType
|
ApplicationDidChangeStatusBarOrientation ApplicationEventType
|
||||||
ApplicationDidFinishLaunching ApplicationEventType
|
ApplicationDidFinishLaunching ApplicationEventType
|
||||||
ApplicationDidHide ApplicationEventType
|
ApplicationDidHide ApplicationEventType
|
||||||
ApplicationDidResignActive ApplicationEventType
|
ApplicationDidResignActiveNotification ApplicationEventType
|
||||||
ApplicationDidUnhide ApplicationEventType
|
ApplicationDidUnhide ApplicationEventType
|
||||||
ApplicationDidUpdate ApplicationEventType
|
ApplicationDidUpdate ApplicationEventType
|
||||||
ApplicationWillBecomeActive ApplicationEventType
|
ApplicationWillBecomeActive ApplicationEventType
|
||||||
@ -112,7 +112,6 @@ type macEvents struct {
|
|||||||
WindowDidResignKey WindowEventType
|
WindowDidResignKey WindowEventType
|
||||||
WindowDidResignMain WindowEventType
|
WindowDidResignMain WindowEventType
|
||||||
WindowDidResize WindowEventType
|
WindowDidResize WindowEventType
|
||||||
WindowDidUnfocus WindowEventType
|
|
||||||
WindowDidUpdate WindowEventType
|
WindowDidUpdate WindowEventType
|
||||||
WindowDidUpdateAlpha WindowEventType
|
WindowDidUpdateAlpha WindowEventType
|
||||||
WindowDidUpdateCollectionBehavior WindowEventType
|
WindowDidUpdateCollectionBehavior WindowEventType
|
||||||
@ -193,7 +192,7 @@ func newMacEvents() macEvents {
|
|||||||
ApplicationDidChangeStatusBarOrientation: 1031,
|
ApplicationDidChangeStatusBarOrientation: 1031,
|
||||||
ApplicationDidFinishLaunching: 1032,
|
ApplicationDidFinishLaunching: 1032,
|
||||||
ApplicationDidHide: 1033,
|
ApplicationDidHide: 1033,
|
||||||
ApplicationDidResignActive: 1034,
|
ApplicationDidResignActiveNotification: 1034,
|
||||||
ApplicationDidUnhide: 1035,
|
ApplicationDidUnhide: 1035,
|
||||||
ApplicationDidUpdate: 1036,
|
ApplicationDidUpdate: 1036,
|
||||||
ApplicationWillBecomeActive: 1037,
|
ApplicationWillBecomeActive: 1037,
|
||||||
@ -239,73 +238,72 @@ func newMacEvents() macEvents {
|
|||||||
WindowDidResignKey: 1077,
|
WindowDidResignKey: 1077,
|
||||||
WindowDidResignMain: 1078,
|
WindowDidResignMain: 1078,
|
||||||
WindowDidResize: 1079,
|
WindowDidResize: 1079,
|
||||||
WindowDidUnfocus: 1080,
|
WindowDidUpdate: 1080,
|
||||||
WindowDidUpdate: 1081,
|
WindowDidUpdateAlpha: 1081,
|
||||||
WindowDidUpdateAlpha: 1082,
|
WindowDidUpdateCollectionBehavior: 1082,
|
||||||
WindowDidUpdateCollectionBehavior: 1083,
|
WindowDidUpdateCollectionProperties: 1083,
|
||||||
WindowDidUpdateCollectionProperties: 1084,
|
WindowDidUpdateShadow: 1084,
|
||||||
WindowDidUpdateShadow: 1085,
|
WindowDidUpdateTitle: 1085,
|
||||||
WindowDidUpdateTitle: 1086,
|
WindowDidUpdateToolbar: 1086,
|
||||||
WindowDidUpdateToolbar: 1087,
|
WindowDidUpdateVisibility: 1087,
|
||||||
WindowDidUpdateVisibility: 1088,
|
WindowShouldClose: 1088,
|
||||||
WindowShouldClose: 1089,
|
WindowWillBecomeKey: 1089,
|
||||||
WindowWillBecomeKey: 1090,
|
WindowWillBecomeMain: 1090,
|
||||||
WindowWillBecomeMain: 1091,
|
WindowWillBeginSheet: 1091,
|
||||||
WindowWillBeginSheet: 1092,
|
WindowWillChangeOrderingMode: 1092,
|
||||||
WindowWillChangeOrderingMode: 1093,
|
WindowWillClose: 1093,
|
||||||
WindowWillClose: 1094,
|
WindowWillDeminiaturize: 1094,
|
||||||
WindowWillDeminiaturize: 1095,
|
WindowWillEnterFullScreen: 1095,
|
||||||
WindowWillEnterFullScreen: 1096,
|
WindowWillEnterVersionBrowser: 1096,
|
||||||
WindowWillEnterVersionBrowser: 1097,
|
WindowWillExitFullScreen: 1097,
|
||||||
WindowWillExitFullScreen: 1098,
|
WindowWillExitVersionBrowser: 1098,
|
||||||
WindowWillExitVersionBrowser: 1099,
|
WindowWillFocus: 1099,
|
||||||
WindowWillFocus: 1100,
|
WindowWillMiniaturize: 1100,
|
||||||
WindowWillMiniaturize: 1101,
|
WindowWillMove: 1101,
|
||||||
WindowWillMove: 1102,
|
WindowWillOrderOffScreen: 1102,
|
||||||
WindowWillOrderOffScreen: 1103,
|
WindowWillOrderOnScreen: 1103,
|
||||||
WindowWillOrderOnScreen: 1104,
|
WindowWillResignMain: 1104,
|
||||||
WindowWillResignMain: 1105,
|
WindowWillResize: 1105,
|
||||||
WindowWillResize: 1106,
|
WindowWillUnfocus: 1106,
|
||||||
WindowWillUnfocus: 1107,
|
WindowWillUpdate: 1107,
|
||||||
WindowWillUpdate: 1108,
|
WindowWillUpdateAlpha: 1108,
|
||||||
WindowWillUpdateAlpha: 1109,
|
WindowWillUpdateCollectionBehavior: 1109,
|
||||||
WindowWillUpdateCollectionBehavior: 1110,
|
WindowWillUpdateCollectionProperties: 1110,
|
||||||
WindowWillUpdateCollectionProperties: 1111,
|
WindowWillUpdateShadow: 1111,
|
||||||
WindowWillUpdateShadow: 1112,
|
WindowWillUpdateTitle: 1112,
|
||||||
WindowWillUpdateTitle: 1113,
|
WindowWillUpdateToolbar: 1113,
|
||||||
WindowWillUpdateToolbar: 1114,
|
WindowWillUpdateVisibility: 1114,
|
||||||
WindowWillUpdateVisibility: 1115,
|
WindowWillUseStandardFrame: 1115,
|
||||||
WindowWillUseStandardFrame: 1116,
|
MenuWillOpen: 1116,
|
||||||
MenuWillOpen: 1117,
|
MenuDidOpen: 1117,
|
||||||
MenuDidOpen: 1118,
|
MenuDidClose: 1118,
|
||||||
MenuDidClose: 1119,
|
MenuWillSendAction: 1119,
|
||||||
MenuWillSendAction: 1120,
|
MenuDidSendAction: 1120,
|
||||||
MenuDidSendAction: 1121,
|
MenuWillHighlightItem: 1121,
|
||||||
MenuWillHighlightItem: 1122,
|
MenuDidHighlightItem: 1122,
|
||||||
MenuDidHighlightItem: 1123,
|
MenuWillDisplayItem: 1123,
|
||||||
MenuWillDisplayItem: 1124,
|
MenuDidDisplayItem: 1124,
|
||||||
MenuDidDisplayItem: 1125,
|
MenuWillAddItem: 1125,
|
||||||
MenuWillAddItem: 1126,
|
MenuDidAddItem: 1126,
|
||||||
MenuDidAddItem: 1127,
|
MenuWillRemoveItem: 1127,
|
||||||
MenuWillRemoveItem: 1128,
|
MenuDidRemoveItem: 1128,
|
||||||
MenuDidRemoveItem: 1129,
|
MenuWillBeginTracking: 1129,
|
||||||
MenuWillBeginTracking: 1130,
|
MenuDidBeginTracking: 1130,
|
||||||
MenuDidBeginTracking: 1131,
|
MenuWillEndTracking: 1131,
|
||||||
MenuWillEndTracking: 1132,
|
MenuDidEndTracking: 1132,
|
||||||
MenuDidEndTracking: 1133,
|
MenuWillUpdate: 1133,
|
||||||
MenuWillUpdate: 1134,
|
MenuDidUpdate: 1134,
|
||||||
MenuDidUpdate: 1135,
|
MenuWillPopUp: 1135,
|
||||||
MenuWillPopUp: 1136,
|
MenuDidPopUp: 1136,
|
||||||
MenuDidPopUp: 1137,
|
MenuWillSendActionToItem: 1137,
|
||||||
MenuWillSendActionToItem: 1138,
|
MenuDidSendActionToItem: 1138,
|
||||||
MenuDidSendActionToItem: 1139,
|
WebViewDidStartProvisionalNavigation: 1139,
|
||||||
WebViewDidStartProvisionalNavigation: 1140,
|
WebViewDidReceiveServerRedirectForProvisionalNavigation: 1140,
|
||||||
WebViewDidReceiveServerRedirectForProvisionalNavigation: 1141,
|
WebViewDidFinishNavigation: 1141,
|
||||||
WebViewDidFinishNavigation: 1142,
|
WebViewDidCommitNavigation: 1142,
|
||||||
WebViewDidCommitNavigation: 1143,
|
WindowFileDraggingEntered: 1143,
|
||||||
WindowFileDraggingEntered: 1144,
|
WindowFileDraggingPerformed: 1144,
|
||||||
WindowFileDraggingPerformed: 1145,
|
WindowFileDraggingExited: 1145,
|
||||||
WindowFileDraggingExited: 1146,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -323,13 +321,13 @@ type windowsEvents struct {
|
|||||||
|
|
||||||
func newWindowsEvents() windowsEvents {
|
func newWindowsEvents() windowsEvents {
|
||||||
return windowsEvents{
|
return windowsEvents{
|
||||||
SystemThemeChanged: 1147,
|
SystemThemeChanged: 1146,
|
||||||
APMPowerStatusChange: 1148,
|
APMPowerStatusChange: 1147,
|
||||||
APMSuspend: 1149,
|
APMSuspend: 1148,
|
||||||
APMResumeAutomatic: 1150,
|
APMResumeAutomatic: 1149,
|
||||||
APMResumeSuspend: 1151,
|
APMResumeSuspend: 1150,
|
||||||
APMPowerSettingChange: 1152,
|
APMPowerSettingChange: 1151,
|
||||||
WebViewNavigationCompleted: 1153,
|
WebViewNavigationCompleted: 1152,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -348,7 +346,7 @@ var eventToJS = map[uint]string{
|
|||||||
1031: "mac:ApplicationDidChangeStatusBarOrientation",
|
1031: "mac:ApplicationDidChangeStatusBarOrientation",
|
||||||
1032: "mac:ApplicationDidFinishLaunching",
|
1032: "mac:ApplicationDidFinishLaunching",
|
||||||
1033: "mac:ApplicationDidHide",
|
1033: "mac:ApplicationDidHide",
|
||||||
1034: "mac:ApplicationDidResignActive",
|
1034: "mac:ApplicationDidResignActiveNotification",
|
||||||
1035: "mac:ApplicationDidUnhide",
|
1035: "mac:ApplicationDidUnhide",
|
||||||
1036: "mac:ApplicationDidUpdate",
|
1036: "mac:ApplicationDidUpdate",
|
||||||
1037: "mac:ApplicationWillBecomeActive",
|
1037: "mac:ApplicationWillBecomeActive",
|
||||||
@ -394,96 +392,95 @@ var eventToJS = map[uint]string{
|
|||||||
1077: "mac:WindowDidResignKey",
|
1077: "mac:WindowDidResignKey",
|
||||||
1078: "mac:WindowDidResignMain",
|
1078: "mac:WindowDidResignMain",
|
||||||
1079: "mac:WindowDidResize",
|
1079: "mac:WindowDidResize",
|
||||||
1080: "mac:WindowDidUnfocus",
|
1080: "mac:WindowDidUpdate",
|
||||||
1081: "mac:WindowDidUpdate",
|
1081: "mac:WindowDidUpdateAlpha",
|
||||||
1082: "mac:WindowDidUpdateAlpha",
|
1082: "mac:WindowDidUpdateCollectionBehavior",
|
||||||
1083: "mac:WindowDidUpdateCollectionBehavior",
|
1083: "mac:WindowDidUpdateCollectionProperties",
|
||||||
1084: "mac:WindowDidUpdateCollectionProperties",
|
1084: "mac:WindowDidUpdateShadow",
|
||||||
1085: "mac:WindowDidUpdateShadow",
|
1085: "mac:WindowDidUpdateTitle",
|
||||||
1086: "mac:WindowDidUpdateTitle",
|
1086: "mac:WindowDidUpdateToolbar",
|
||||||
1087: "mac:WindowDidUpdateToolbar",
|
1087: "mac:WindowDidUpdateVisibility",
|
||||||
1088: "mac:WindowDidUpdateVisibility",
|
1088: "mac:WindowShouldClose!",
|
||||||
1089: "mac:WindowShouldClose!",
|
1089: "mac:WindowWillBecomeKey",
|
||||||
1090: "mac:WindowWillBecomeKey",
|
1090: "mac:WindowWillBecomeMain",
|
||||||
1091: "mac:WindowWillBecomeMain",
|
1091: "mac:WindowWillBeginSheet",
|
||||||
1092: "mac:WindowWillBeginSheet",
|
1092: "mac:WindowWillChangeOrderingMode",
|
||||||
1093: "mac:WindowWillChangeOrderingMode",
|
1093: "mac:WindowWillClose",
|
||||||
1094: "mac:WindowWillClose",
|
1094: "mac:WindowWillDeminiaturize",
|
||||||
1095: "mac:WindowWillDeminiaturize",
|
1095: "mac:WindowWillEnterFullScreen",
|
||||||
1096: "mac:WindowWillEnterFullScreen",
|
1096: "mac:WindowWillEnterVersionBrowser",
|
||||||
1097: "mac:WindowWillEnterVersionBrowser",
|
1097: "mac:WindowWillExitFullScreen",
|
||||||
1098: "mac:WindowWillExitFullScreen",
|
1098: "mac:WindowWillExitVersionBrowser",
|
||||||
1099: "mac:WindowWillExitVersionBrowser",
|
1099: "mac:WindowWillFocus",
|
||||||
1100: "mac:WindowWillFocus",
|
1100: "mac:WindowWillMiniaturize",
|
||||||
1101: "mac:WindowWillMiniaturize",
|
1101: "mac:WindowWillMove",
|
||||||
1102: "mac:WindowWillMove",
|
1102: "mac:WindowWillOrderOffScreen",
|
||||||
1103: "mac:WindowWillOrderOffScreen",
|
1103: "mac:WindowWillOrderOnScreen",
|
||||||
1104: "mac:WindowWillOrderOnScreen",
|
1104: "mac:WindowWillResignMain",
|
||||||
1105: "mac:WindowWillResignMain",
|
1105: "mac:WindowWillResize",
|
||||||
1106: "mac:WindowWillResize",
|
1106: "mac:WindowWillUnfocus",
|
||||||
1107: "mac:WindowWillUnfocus",
|
1107: "mac:WindowWillUpdate",
|
||||||
1108: "mac:WindowWillUpdate",
|
1108: "mac:WindowWillUpdateAlpha",
|
||||||
1109: "mac:WindowWillUpdateAlpha",
|
1109: "mac:WindowWillUpdateCollectionBehavior",
|
||||||
1110: "mac:WindowWillUpdateCollectionBehavior",
|
1110: "mac:WindowWillUpdateCollectionProperties",
|
||||||
1111: "mac:WindowWillUpdateCollectionProperties",
|
1111: "mac:WindowWillUpdateShadow",
|
||||||
1112: "mac:WindowWillUpdateShadow",
|
1112: "mac:WindowWillUpdateTitle",
|
||||||
1113: "mac:WindowWillUpdateTitle",
|
1113: "mac:WindowWillUpdateToolbar",
|
||||||
1114: "mac:WindowWillUpdateToolbar",
|
1114: "mac:WindowWillUpdateVisibility",
|
||||||
1115: "mac:WindowWillUpdateVisibility",
|
1115: "mac:WindowWillUseStandardFrame",
|
||||||
1116: "mac:WindowWillUseStandardFrame",
|
1116: "mac:MenuWillOpen",
|
||||||
1117: "mac:MenuWillOpen",
|
1117: "mac:MenuDidOpen",
|
||||||
1118: "mac:MenuDidOpen",
|
1118: "mac:MenuDidClose",
|
||||||
1119: "mac:MenuDidClose",
|
1119: "mac:MenuWillSendAction",
|
||||||
1120: "mac:MenuWillSendAction",
|
1120: "mac:MenuDidSendAction",
|
||||||
1121: "mac:MenuDidSendAction",
|
1121: "mac:MenuWillHighlightItem",
|
||||||
1122: "mac:MenuWillHighlightItem",
|
1122: "mac:MenuDidHighlightItem",
|
||||||
1123: "mac:MenuDidHighlightItem",
|
1123: "mac:MenuWillDisplayItem",
|
||||||
1124: "mac:MenuWillDisplayItem",
|
1124: "mac:MenuDidDisplayItem",
|
||||||
1125: "mac:MenuDidDisplayItem",
|
1125: "mac:MenuWillAddItem",
|
||||||
1126: "mac:MenuWillAddItem",
|
1126: "mac:MenuDidAddItem",
|
||||||
1127: "mac:MenuDidAddItem",
|
1127: "mac:MenuWillRemoveItem",
|
||||||
1128: "mac:MenuWillRemoveItem",
|
1128: "mac:MenuDidRemoveItem",
|
||||||
1129: "mac:MenuDidRemoveItem",
|
1129: "mac:MenuWillBeginTracking",
|
||||||
1130: "mac:MenuWillBeginTracking",
|
1130: "mac:MenuDidBeginTracking",
|
||||||
1131: "mac:MenuDidBeginTracking",
|
1131: "mac:MenuWillEndTracking",
|
||||||
1132: "mac:MenuWillEndTracking",
|
1132: "mac:MenuDidEndTracking",
|
||||||
1133: "mac:MenuDidEndTracking",
|
1133: "mac:MenuWillUpdate",
|
||||||
1134: "mac:MenuWillUpdate",
|
1134: "mac:MenuDidUpdate",
|
||||||
1135: "mac:MenuDidUpdate",
|
1135: "mac:MenuWillPopUp",
|
||||||
1136: "mac:MenuWillPopUp",
|
1136: "mac:MenuDidPopUp",
|
||||||
1137: "mac:MenuDidPopUp",
|
1137: "mac:MenuWillSendActionToItem",
|
||||||
1138: "mac:MenuWillSendActionToItem",
|
1138: "mac:MenuDidSendActionToItem",
|
||||||
1139: "mac:MenuDidSendActionToItem",
|
1139: "mac:WebViewDidStartProvisionalNavigation",
|
||||||
1140: "mac:WebViewDidStartProvisionalNavigation",
|
1140: "mac:WebViewDidReceiveServerRedirectForProvisionalNavigation",
|
||||||
1141: "mac:WebViewDidReceiveServerRedirectForProvisionalNavigation",
|
1141: "mac:WebViewDidFinishNavigation",
|
||||||
1142: "mac:WebViewDidFinishNavigation",
|
1142: "mac:WebViewDidCommitNavigation",
|
||||||
1143: "mac:WebViewDidCommitNavigation",
|
1143: "mac:WindowFileDraggingEntered",
|
||||||
1144: "mac:WindowFileDraggingEntered",
|
1144: "mac:WindowFileDraggingPerformed",
|
||||||
1145: "mac:WindowFileDraggingPerformed",
|
1145: "mac:WindowFileDraggingExited",
|
||||||
1146: "mac:WindowFileDraggingExited",
|
1146: "windows:SystemThemeChanged",
|
||||||
1147: "windows:SystemThemeChanged",
|
1147: "windows:APMPowerStatusChange",
|
||||||
1148: "windows:APMPowerStatusChange",
|
1148: "windows:APMSuspend",
|
||||||
1149: "windows:APMSuspend",
|
1149: "windows:APMResumeAutomatic",
|
||||||
1150: "windows:APMResumeAutomatic",
|
1150: "windows:APMResumeSuspend",
|
||||||
1151: "windows:APMResumeSuspend",
|
1151: "windows:APMPowerSettingChange",
|
||||||
1152: "windows:APMPowerSettingChange",
|
1152: "windows:WebViewNavigationCompleted",
|
||||||
1153: "windows:WebViewNavigationCompleted",
|
1153: "common:ApplicationStarted",
|
||||||
1154: "common:ApplicationStarted",
|
1154: "common:WindowMaximise",
|
||||||
1155: "common:WindowMaximise",
|
1155: "common:WindowUnMaximise",
|
||||||
1156: "common:WindowUnMaximise",
|
1156: "common:WindowFullscreen",
|
||||||
1157: "common:WindowFullscreen",
|
1157: "common:WindowUnFullscreen",
|
||||||
1158: "common:WindowUnFullscreen",
|
1158: "common:WindowRestore",
|
||||||
1159: "common:WindowRestore",
|
1159: "common:WindowMinimise",
|
||||||
1160: "common:WindowMinimise",
|
1160: "common:WindowUnMinimise",
|
||||||
1161: "common:WindowUnMinimise",
|
1161: "common:WindowClosing",
|
||||||
1162: "common:WindowClosing",
|
1162: "common:WindowZoom",
|
||||||
1163: "common:WindowZoom",
|
1163: "common:WindowZoomIn",
|
||||||
1164: "common:WindowZoomIn",
|
1164: "common:WindowZoomOut",
|
||||||
1165: "common:WindowZoomOut",
|
1165: "common:WindowZoomReset",
|
||||||
1166: "common:WindowZoomReset",
|
1166: "common:WindowFocus",
|
||||||
1167: "common:WindowFocus",
|
1167: "common:WindowLostFocus",
|
||||||
1168: "common:WindowUnFocus",
|
1168: "common:WindowShow",
|
||||||
1169: "common:WindowShow",
|
1169: "common:WindowHide",
|
||||||
1170: "common:WindowHide",
|
1170: "common:WindowDPIChanged",
|
||||||
1171: "common:WindowDPIChanged",
|
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ extern void processWindowEvent(unsigned int, unsigned int);
|
|||||||
#define EventApplicationDidChangeStatusBarOrientation 1031
|
#define EventApplicationDidChangeStatusBarOrientation 1031
|
||||||
#define EventApplicationDidFinishLaunching 1032
|
#define EventApplicationDidFinishLaunching 1032
|
||||||
#define EventApplicationDidHide 1033
|
#define EventApplicationDidHide 1033
|
||||||
#define EventApplicationDidResignActive 1034
|
#define EventApplicationDidResignActiveNotification 1034
|
||||||
#define EventApplicationDidUnhide 1035
|
#define EventApplicationDidUnhide 1035
|
||||||
#define EventApplicationDidUpdate 1036
|
#define EventApplicationDidUpdate 1036
|
||||||
#define EventApplicationWillBecomeActive 1037
|
#define EventApplicationWillBecomeActive 1037
|
||||||
@ -62,75 +62,74 @@ extern void processWindowEvent(unsigned int, unsigned int);
|
|||||||
#define EventWindowDidResignKey 1077
|
#define EventWindowDidResignKey 1077
|
||||||
#define EventWindowDidResignMain 1078
|
#define EventWindowDidResignMain 1078
|
||||||
#define EventWindowDidResize 1079
|
#define EventWindowDidResize 1079
|
||||||
#define EventWindowDidUnfocus 1080
|
#define EventWindowDidUpdate 1080
|
||||||
#define EventWindowDidUpdate 1081
|
#define EventWindowDidUpdateAlpha 1081
|
||||||
#define EventWindowDidUpdateAlpha 1082
|
#define EventWindowDidUpdateCollectionBehavior 1082
|
||||||
#define EventWindowDidUpdateCollectionBehavior 1083
|
#define EventWindowDidUpdateCollectionProperties 1083
|
||||||
#define EventWindowDidUpdateCollectionProperties 1084
|
#define EventWindowDidUpdateShadow 1084
|
||||||
#define EventWindowDidUpdateShadow 1085
|
#define EventWindowDidUpdateTitle 1085
|
||||||
#define EventWindowDidUpdateTitle 1086
|
#define EventWindowDidUpdateToolbar 1086
|
||||||
#define EventWindowDidUpdateToolbar 1087
|
#define EventWindowDidUpdateVisibility 1087
|
||||||
#define EventWindowDidUpdateVisibility 1088
|
#define EventWindowShouldClose 1088
|
||||||
#define EventWindowShouldClose 1089
|
#define EventWindowWillBecomeKey 1089
|
||||||
#define EventWindowWillBecomeKey 1090
|
#define EventWindowWillBecomeMain 1090
|
||||||
#define EventWindowWillBecomeMain 1091
|
#define EventWindowWillBeginSheet 1091
|
||||||
#define EventWindowWillBeginSheet 1092
|
#define EventWindowWillChangeOrderingMode 1092
|
||||||
#define EventWindowWillChangeOrderingMode 1093
|
#define EventWindowWillClose 1093
|
||||||
#define EventWindowWillClose 1094
|
#define EventWindowWillDeminiaturize 1094
|
||||||
#define EventWindowWillDeminiaturize 1095
|
#define EventWindowWillEnterFullScreen 1095
|
||||||
#define EventWindowWillEnterFullScreen 1096
|
#define EventWindowWillEnterVersionBrowser 1096
|
||||||
#define EventWindowWillEnterVersionBrowser 1097
|
#define EventWindowWillExitFullScreen 1097
|
||||||
#define EventWindowWillExitFullScreen 1098
|
#define EventWindowWillExitVersionBrowser 1098
|
||||||
#define EventWindowWillExitVersionBrowser 1099
|
#define EventWindowWillFocus 1099
|
||||||
#define EventWindowWillFocus 1100
|
#define EventWindowWillMiniaturize 1100
|
||||||
#define EventWindowWillMiniaturize 1101
|
#define EventWindowWillMove 1101
|
||||||
#define EventWindowWillMove 1102
|
#define EventWindowWillOrderOffScreen 1102
|
||||||
#define EventWindowWillOrderOffScreen 1103
|
#define EventWindowWillOrderOnScreen 1103
|
||||||
#define EventWindowWillOrderOnScreen 1104
|
#define EventWindowWillResignMain 1104
|
||||||
#define EventWindowWillResignMain 1105
|
#define EventWindowWillResize 1105
|
||||||
#define EventWindowWillResize 1106
|
#define EventWindowWillUnfocus 1106
|
||||||
#define EventWindowWillUnfocus 1107
|
#define EventWindowWillUpdate 1107
|
||||||
#define EventWindowWillUpdate 1108
|
#define EventWindowWillUpdateAlpha 1108
|
||||||
#define EventWindowWillUpdateAlpha 1109
|
#define EventWindowWillUpdateCollectionBehavior 1109
|
||||||
#define EventWindowWillUpdateCollectionBehavior 1110
|
#define EventWindowWillUpdateCollectionProperties 1110
|
||||||
#define EventWindowWillUpdateCollectionProperties 1111
|
#define EventWindowWillUpdateShadow 1111
|
||||||
#define EventWindowWillUpdateShadow 1112
|
#define EventWindowWillUpdateTitle 1112
|
||||||
#define EventWindowWillUpdateTitle 1113
|
#define EventWindowWillUpdateToolbar 1113
|
||||||
#define EventWindowWillUpdateToolbar 1114
|
#define EventWindowWillUpdateVisibility 1114
|
||||||
#define EventWindowWillUpdateVisibility 1115
|
#define EventWindowWillUseStandardFrame 1115
|
||||||
#define EventWindowWillUseStandardFrame 1116
|
#define EventMenuWillOpen 1116
|
||||||
#define EventMenuWillOpen 1117
|
#define EventMenuDidOpen 1117
|
||||||
#define EventMenuDidOpen 1118
|
#define EventMenuDidClose 1118
|
||||||
#define EventMenuDidClose 1119
|
#define EventMenuWillSendAction 1119
|
||||||
#define EventMenuWillSendAction 1120
|
#define EventMenuDidSendAction 1120
|
||||||
#define EventMenuDidSendAction 1121
|
#define EventMenuWillHighlightItem 1121
|
||||||
#define EventMenuWillHighlightItem 1122
|
#define EventMenuDidHighlightItem 1122
|
||||||
#define EventMenuDidHighlightItem 1123
|
#define EventMenuWillDisplayItem 1123
|
||||||
#define EventMenuWillDisplayItem 1124
|
#define EventMenuDidDisplayItem 1124
|
||||||
#define EventMenuDidDisplayItem 1125
|
#define EventMenuWillAddItem 1125
|
||||||
#define EventMenuWillAddItem 1126
|
#define EventMenuDidAddItem 1126
|
||||||
#define EventMenuDidAddItem 1127
|
#define EventMenuWillRemoveItem 1127
|
||||||
#define EventMenuWillRemoveItem 1128
|
#define EventMenuDidRemoveItem 1128
|
||||||
#define EventMenuDidRemoveItem 1129
|
#define EventMenuWillBeginTracking 1129
|
||||||
#define EventMenuWillBeginTracking 1130
|
#define EventMenuDidBeginTracking 1130
|
||||||
#define EventMenuDidBeginTracking 1131
|
#define EventMenuWillEndTracking 1131
|
||||||
#define EventMenuWillEndTracking 1132
|
#define EventMenuDidEndTracking 1132
|
||||||
#define EventMenuDidEndTracking 1133
|
#define EventMenuWillUpdate 1133
|
||||||
#define EventMenuWillUpdate 1134
|
#define EventMenuDidUpdate 1134
|
||||||
#define EventMenuDidUpdate 1135
|
#define EventMenuWillPopUp 1135
|
||||||
#define EventMenuWillPopUp 1136
|
#define EventMenuDidPopUp 1136
|
||||||
#define EventMenuDidPopUp 1137
|
#define EventMenuWillSendActionToItem 1137
|
||||||
#define EventMenuWillSendActionToItem 1138
|
#define EventMenuDidSendActionToItem 1138
|
||||||
#define EventMenuDidSendActionToItem 1139
|
#define EventWebViewDidStartProvisionalNavigation 1139
|
||||||
#define EventWebViewDidStartProvisionalNavigation 1140
|
#define EventWebViewDidReceiveServerRedirectForProvisionalNavigation 1140
|
||||||
#define EventWebViewDidReceiveServerRedirectForProvisionalNavigation 1141
|
#define EventWebViewDidFinishNavigation 1141
|
||||||
#define EventWebViewDidFinishNavigation 1142
|
#define EventWebViewDidCommitNavigation 1142
|
||||||
#define EventWebViewDidCommitNavigation 1143
|
#define EventWindowFileDraggingEntered 1143
|
||||||
#define EventWindowFileDraggingEntered 1144
|
#define EventWindowFileDraggingPerformed 1144
|
||||||
#define EventWindowFileDraggingPerformed 1145
|
#define EventWindowFileDraggingExited 1145
|
||||||
#define EventWindowFileDraggingExited 1146
|
|
||||||
|
|
||||||
#define MAX_EVENTS 1147
|
#define MAX_EVENTS 1146
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -8,7 +8,7 @@ mac:ApplicationDidChangeStatusBarFrame
|
|||||||
mac:ApplicationDidChangeStatusBarOrientation
|
mac:ApplicationDidChangeStatusBarOrientation
|
||||||
mac:ApplicationDidFinishLaunching
|
mac:ApplicationDidFinishLaunching
|
||||||
mac:ApplicationDidHide
|
mac:ApplicationDidHide
|
||||||
mac:ApplicationDidResignActive
|
mac:ApplicationDidResignActiveNotification
|
||||||
mac:ApplicationDidUnhide
|
mac:ApplicationDidUnhide
|
||||||
mac:ApplicationDidUpdate
|
mac:ApplicationDidUpdate
|
||||||
mac:ApplicationWillBecomeActive
|
mac:ApplicationWillBecomeActive
|
||||||
@ -54,7 +54,6 @@ mac:WindowDidOrderOnScreen
|
|||||||
mac:WindowDidResignKey
|
mac:WindowDidResignKey
|
||||||
mac:WindowDidResignMain
|
mac:WindowDidResignMain
|
||||||
mac:WindowDidResize
|
mac:WindowDidResize
|
||||||
mac:WindowDidUnfocus
|
|
||||||
mac:WindowDidUpdate
|
mac:WindowDidUpdate
|
||||||
mac:WindowDidUpdateAlpha
|
mac:WindowDidUpdateAlpha
|
||||||
mac:WindowDidUpdateCollectionBehavior
|
mac:WindowDidUpdateCollectionBehavior
|
||||||
@ -142,7 +141,7 @@ common:WindowZoomIn
|
|||||||
common:WindowZoomOut
|
common:WindowZoomOut
|
||||||
common:WindowZoomReset
|
common:WindowZoomReset
|
||||||
common:WindowFocus
|
common:WindowFocus
|
||||||
common:WindowUnFocus
|
common:WindowLostFocus
|
||||||
common:WindowShow
|
common:WindowShow
|
||||||
common:WindowHide
|
common:WindowHide
|
||||||
common:WindowDPIChanged
|
common:WindowDPIChanged
|
||||||
|
Loading…
Reference in New Issue
Block a user