Skip to content

Commit 9fcb7c4

Browse files
committed
Solution for basic windows drivers
1 parent b228632 commit 9fcb7c4

2 files changed

Lines changed: 59 additions & 4 deletions

File tree

README.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,40 @@ You can download the latest pre-compiled binaries for Windows and Linux from the
101101

102102
#### Windows
103103
```powershell
104-
type "$env:APPDATA\WeatherWidget\WeatherWidget\config.json"
104+
type $env:APPDATA\WeatherWidget\WeatherWidget\config.json
105105
```
106106
#### Linux
107107
```bash
108108
cat $HOME/.config/WeatherWidget/WeatherWidget/config.json
109-
```
109+
```
110+
111+
## Troubleshooting
112+
113+
### "Nothing happens" when clicking Settings or Weather Panel
114+
If the app appears in your system tray (or is running in the background) but clicking **Settings** or **Show Weather** does nothing, it usually means the application failed to create the UI window.
115+
116+
You can verify this by running the application from the command line with the `-debug` flag to enable logging to a file:
117+
```powershell
118+
.\weatherwidget.exe -debug
119+
```
120+
Then, check the log file at:
121+
```powershell
122+
type $env:APPDATA\WeatherWidget\debug.log
123+
```
124+
125+
If you see the following error:
126+
`Cause: APIUnavailable: WGL: The driver does not appear to support OpenGL`
127+
128+
**The Fix:**
129+
This happens on "clean" Windows installations (using the Microsoft Basic Display Adapter) or in Virtual Machines because the system lacks proper graphics drivers to support the required OpenGL 2.0+ context.
130+
131+
There are two ways to fix this:
132+
1. **Install Graphics Drivers:** Install the proper Intel/AMD/NVIDIA graphics drivers for your system.
133+
2. **Use Mesa3D Software Renderer (Portable Fix):** If installing drivers is not an option:
134+
* Download a pre-compiled **Mesa3D for Windows** package (e.g., from [fdossena.com](https://fdossena.com/?p=mesa/index.frag)).
135+
* Extract the **64-bit `opengl32.dll`** file.
136+
* Place that `opengl32.dll` file directly in the same folder as your `weatherwidget.exe`.
137+
138+
Windows will automatically use this DLL to translate OpenGL hardware calls into software rendering, allowing the app to work flawlessly on any PC regardless of graphics drivers.
139+
140+
*Note: A `-software` flag is also available (`.\weatherwidget.exe -software`) which instructs the Fyne framework to prefer software rendering, but this still requires basic OpenGL driver availability at the OS level.*

cmd/weatherwidget/main.go

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
package main
33

44
import (
5+
"flag"
56
"log"
67
"os"
78
"path/filepath"
@@ -18,11 +19,34 @@ import (
1819
var version = "dev"
1920

2021
func main() {
21-
fyneApp := app.NewWithID("com.weatherwidget")
22-
fyneApp.Settings().SetTheme(ui.NewWidgetTheme(theme.DefaultTheme()))
22+
debugFlag := flag.Bool("debug", false, "Enable debug logging to a file")
23+
softwareFlag := flag.Bool("software", false, "Use software rendering (fixes OpenGL driver issues)")
24+
flag.Parse()
25+
26+
if *softwareFlag {
27+
os.Setenv("FYNE_RENDER", "software")
28+
}
2329

2430
appDataDir := appDataDirectory()
2531

32+
if err := os.MkdirAll(appDataDir, 0755); err != nil {
33+
log.Printf("failed to create app data directory: %v", err)
34+
}
35+
36+
if *debugFlag {
37+
logPath := filepath.Join(appDataDir, "debug.log")
38+
logFile, err := os.OpenFile(logPath, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
39+
if err == nil {
40+
log.SetOutput(logFile)
41+
log.Printf("--- Debug logging enabled (version: %s) ---", version)
42+
} else {
43+
log.Printf("failed to open debug log file: %v", err)
44+
}
45+
}
46+
47+
fyneApp := app.NewWithID("com.weatherwidget")
48+
fyneApp.Settings().SetTheme(ui.NewWidgetTheme(theme.DefaultTheme()))
49+
2650
manager := appmanager.NewAppManager(fyneApp, appDataDir)
2751
if err := manager.Run(); err != nil {
2852
log.Fatalf("failed to start WeatherWidget: %v", err)

0 commit comments

Comments
 (0)