chore: MSWindows only items initilize members in header

This commit is contained in:
sithlord48
2025-05-23 20:12:30 -04:00
committed by Nick Bolton
parent 3eb3969a01
commit 9eabbb690c
6 changed files with 43 additions and 81 deletions

View File

@ -112,19 +112,7 @@ MSWindowsDesks::MSWindowsDesks(
: m_isPrimary(isPrimary),
m_noHooks(noHooks),
m_isOnScreen(m_isPrimary),
m_x(0),
m_y(0),
m_w(0),
m_h(0),
m_xCenter(0),
m_yCenter(0),
m_multimon(false),
m_timer(nullptr),
m_screensaver(screensaver),
m_screensaverNotify(false),
m_activeDesk(nullptr),
m_activeDeskName(),
m_mutex(),
m_deskReady(&m_mutex, false),
m_updateKeys(updateKeys),
m_events(events)

View File

@ -243,23 +243,26 @@ private:
HCURSOR m_cursor;
// screen shape stuff
int32_t m_x, m_y;
int32_t m_w, m_h;
int32_t m_xCenter, m_yCenter;
int32_t m_x = 0;
int32_t m_y = 9;
int32_t m_w = 0;
int32_t m_h = 0;
int32_t m_xCenter = 0;
int32_t m_yCenter = 0;
// true if system appears to have multiple monitors
bool m_multimon;
bool m_multimon = false;
// the timer used to check for desktop switching
EventQueueTimer *m_timer;
EventQueueTimer *m_timer = nullptr;
// screen saver stuff
DWORD m_threadID;
const IScreenSaver *m_screensaver;
bool m_screensaverNotify;
bool m_screensaverNotify = false;
// the current desk and it's name
Desk *m_activeDesk;
Desk *m_activeDesk = nullptr;
std::string m_activeDeskName;
// one desk per desktop and a cond var to communicate with it

View File

@ -88,31 +88,7 @@ MSWindowsScreen::MSWindowsScreen(
m_isPrimary(isPrimary),
m_noHooks(noHooks),
m_isOnScreen(m_isPrimary),
m_class(0),
m_x(0),
m_y(0),
m_w(0),
m_h(0),
m_xCenter(0),
m_yCenter(0),
m_multimon(false),
m_xCursor(0),
m_yCursor(0),
m_sequenceNumber(0),
m_mark(0),
m_markReceived(0),
m_fixTimer(nullptr),
m_keyLayout(nullptr),
m_screensaver(nullptr),
m_screensaverNotify(false),
m_screensaverActive(false),
m_window(nullptr),
m_clipboardSequenceNumber(0),
m_ownClipboard(false),
m_desks(nullptr),
m_keyState(nullptr),
m_hasMouse(GetSystemMetrics(SM_MOUSEPRESENT) != 0),
m_showingMouse(false),
m_events(events)
{
assert(s_windowInstance != nullptr);

View File

@ -259,51 +259,55 @@ private:
bool m_isOnScreen;
// our resources
ATOM m_class;
ATOM m_class = 0;
// screen shape stuff
int32_t m_x, m_y;
int32_t m_w, m_h;
int32_t m_xCenter, m_yCenter;
int32_t m_x = 0;
int32_t m_y = 0;
int32_t m_w = 0;
int32_t m_h = 0;
int32_t m_xCenter = 0;
int32_t m_yCenter = 0;
// true if system appears to have multiple monitors
bool m_multimon;
bool m_multimon = false;
// last mouse position
int32_t m_xCursor, m_yCursor;
int32_t m_xCursor = 0;
int32_t m_yCursor = 0;
// last clipboard
uint32_t m_sequenceNumber;
uint32_t m_sequenceNumber = 0;
// used to discard queued messages that are no longer needed
uint32_t m_mark;
uint32_t m_markReceived;
uint32_t m_mark = 0;
uint32_t m_markReceived = 0;
// the main loop's thread id
DWORD m_threadID;
// timer for periodically checking stuff that requires polling
EventQueueTimer *m_fixTimer;
EventQueueTimer *m_fixTimer = nullptr;
// the keyboard layout to use when off primary screen
HKL m_keyLayout;
HKL m_keyLayout = nullptr;
// screen saver stuff
MSWindowsScreenSaver *m_screensaver;
bool m_screensaverNotify;
bool m_screensaverActive;
MSWindowsScreenSaver *m_screensaver = nullptr;
bool m_screensaverNotify = false;
bool m_screensaverActive = false;
// clipboard stuff. our window is used mainly as a clipboard
// owner and as a link in the clipboard viewer chain.
HWND m_window;
DWORD m_clipboardSequenceNumber;
bool m_ownClipboard;
HWND m_window = nullptr;
DWORD m_clipboardSequenceNumber = 0;
bool m_ownClipboard = false;
// one desk per desktop and a cond var to communicate with it
MSWindowsDesks *m_desks;
MSWindowsDesks *m_desks = nullptr;
// keyboard stuff
MSWindowsKeyState *m_keyState;
MSWindowsKeyState *m_keyState = nullptr;
// hot key stuff
HotKeyMap m_hotKeys;
@ -325,7 +329,7 @@ private:
// cursor to be displayed when the user has entered this screen.
// m_showingMouse is true when we're doing that.
bool m_hasMouse;
bool m_showingMouse;
bool m_showingMouse = false;
bool m_gotOldMouseKeys;
MOUSEKEYS m_mouseKeys;
MOUSEKEYS m_oldMouseKeys;

View File

@ -30,15 +30,6 @@ static const TCHAR *const g_pathScreenSaverIsSecure[] = {"Control Panel", "Deskt
//
MSWindowsScreenSaver::MSWindowsScreenSaver()
: m_wasSecure(false),
m_wasSecureAnInt(false),
m_process(nullptr),
m_watch(nullptr),
m_threadID(0),
m_msg(0),
m_wParam(0),
m_lParam(0),
m_active(false)
{
// check if screen saver is enabled
SystemParametersInfo(SPI_GETSCREENSAVEACTIVE, 0, &m_wasEnabled, 0);

View File

@ -63,17 +63,17 @@ private:
private:
BOOL m_wasEnabled;
bool m_wasSecure;
bool m_wasSecureAnInt;
bool m_wasSecure = false;
bool m_wasSecureAnInt = false;
HANDLE m_process;
Thread *m_watch;
DWORD m_threadID;
UINT m_msg;
WPARAM m_wParam;
LPARAM m_lParam;
HANDLE m_process = nullptr;
Thread *m_watch = nullptr;
DWORD m_threadID = 0;
UINT m_msg = 0;
WPARAM m_wParam = 0;
LPARAM m_lParam = 0;
// checkActive state. true if the screen saver is being watched
// for deactivation (and is therefore active).
bool m_active;
bool m_active = false;
};