Skip to content

Commit

Permalink
Fixed windows compilation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Szczerbiński committed May 17, 2024
1 parent 465e45d commit 12224ca
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 20 deletions.
5 changes: 4 additions & 1 deletion src/common.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#ifndef COMMON_H
#define COMMON_H

#include "platform_guard.h"

#ifdef __LINUX
#include <linux/limits.h>
#else
#include <windows.h>
#include <Windows.h>
#include <shellscalingapi.h>
#endif

#define MONITOR_NAME_MAX 128
Expand Down
5 changes: 1 addition & 4 deletions src/common/monitorScanner.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@

#include "../common.h"

#ifdef __WIN32
#include <Windows.h>
#include <shellscalingapi.h>
#else
#ifdef __LINUX
#include <X11/Xlib.h>
#include <X11/extensions/Xrandr.h>
#include <string.h>
Expand Down
2 changes: 0 additions & 2 deletions src/core/main.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include "main.h"

#include "../platform_guard.h"

GtkApplication *app = NULL;
GtkBuilder *builder = NULL;

Expand Down
2 changes: 2 additions & 0 deletions src/core/main.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef MAIN_H
#define MAIN_H

#include "../platform_guard.h"

#include <gtk/gtk.h>

#include "../common.h"
Expand Down
2 changes: 1 addition & 1 deletion src/core/resource.template.rc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#define PROGRAM_VER "@PROGRAM_VERSION@"

id ICON "..\..\icon.ico"
id ICON "../../icon.ico"

VS_VERSION_INFO VERSIONINFO
FILEOS VOS_NT
Expand Down
7 changes: 2 additions & 5 deletions src/core/trayIcon.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
#ifdef __WIN32
// clang-format off
#include <windows.h>
#include <shellapi.h>
// clang-format on
#include <tchar.h>

#include "main.h"

#include <tchar.h>

#define WM_TRAY_ICON (WM_USER + 1)

static NOTIFYICONDATA nid;
Expand Down
10 changes: 7 additions & 3 deletions src/platform_guard.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
#ifndef PLATFORM_GUARD_H
#define PLATFORM_GUARD_H

#ifdef __WIN32
#define NTDDI_VERSION 0x0A000000
#endif

#ifndef __WIN32
#ifndef __LINUX

#error "Unsupported platform."

#endif // __LINUX
#endif // __WIN32
#endif // __LINUX
#endif // __WIN32

#endif // PLATFORM_GUARD_H
#endif // PLATFORM_GUARD_H
2 changes: 0 additions & 2 deletions src/wlp/main.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include "main.h"

#include "../platform_guard.h"

static App app;

static void atExit()
Expand Down
2 changes: 2 additions & 0 deletions src/wlp/main.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef MAIN_H
#define MAIN_H

#include "../platform_guard.h"

#ifdef _MSC_VER
#define PATH_MAX MAX_PATH
#include <SDL.h>
Expand Down
4 changes: 2 additions & 2 deletions src/wlp/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ void initWindow(App *app, Monitor *monitor)

HWND progman = FindWindow("Progman", NULL);
iconWorkerw = progman;
SendMessageTimeout(progman, 0x052C, NULL, NULL, SMTO_NORMAL, 1000, NULL);
SendMessageTimeout(progman, 0x052C, 0, 0, SMTO_NORMAL, 1000, NULL);
if (!FindWindowEx(progman, NULL, "SHELLDLL_DefView", NULL))
EnumWindows(getIconWorkerw, NULL);
EnumWindows(getIconWorkerw, 0);

HWND wallpaperWorkerw = GetWindow(iconWorkerw, GW_HWNDNEXT);
SetParent(hWindow, wallpaperWorkerw);
Expand Down

0 comments on commit 12224ca

Please sign in to comment.