-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dc8cbcf
commit 8ddd29d
Showing
8 changed files
with
183 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
//go:build linux | ||
|
||
package application | ||
|
||
import "github.com/wailsapp/wails/v3/pkg/events" | ||
|
||
var commonApplicationEventMap = map[events.ApplicationEventType]events.ApplicationEventType{ | ||
events.Linux.SystemThemeChanged: events.Common.ThemeChanged, | ||
} | ||
|
||
func (m *linuxApp) setupCommonEvents() { | ||
for sourceEvent, targetEvent := range commonApplicationEventMap { | ||
sourceEvent := sourceEvent | ||
targetEvent := targetEvent | ||
m.parent.On(sourceEvent, func(event *Event) { | ||
event.Id = uint(targetEvent) | ||
applicationEvents <- event | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//go:build linux | ||
|
||
package events | ||
|
||
/* | ||
#include "events_linux.h" | ||
#include <stdlib.h> | ||
#include <stdbool.h> | ||
bool hasListener[MAX_EVENTS] = {false}; | ||
void registerListener(unsigned int event) { | ||
hasListener[event] = true; | ||
} | ||
bool hasListeners(unsigned int event) { | ||
return hasListener[event]; | ||
} | ||
*/ | ||
import "C" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//go:build linux | ||
|
||
#ifndef _events_linux_h | ||
#define _events_linux_h | ||
|
||
extern void processApplicationEvent(unsigned int, void* data); | ||
extern void processWindowEvent(unsigned int, unsigned int); | ||
|
||
#define EventSystemThemeChanged 1167 | ||
|
||
#define MAX_EVENTS 2 | ||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters