From 156b8d5d2de1e5eda589c2d2200a8294b5522b24 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Mon, 7 Sep 2009 01:37:22 +0000 Subject: [PATCH] * Initialize member variables. * Remove some unused members. * Avoid initializing the mouse position to non-integer coordinates. * The frame right/bottom are width/height - 1. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32979 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/input/InputServer.cpp | 10 ++++++++-- src/servers/input/InputServer.h | 4 ---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/servers/input/InputServer.cpp b/src/servers/input/InputServer.cpp index 8c791dee70..c428778c4e 100644 --- a/src/servers/input/InputServer.cpp +++ b/src/servers/input/InputServer.cpp @@ -147,11 +147,14 @@ InputDeviceListItem::Matches(const char* name, input_device_type type) const InputServer::InputServer() : BApplication(INPUTSERVER_SIGNATURE), fSafeMode(false), + fKeyboardID(0), fInputDeviceListLocker("input server device list"), fKeyboardSettings(), fMouseSettings(), fChars(NULL), fScreen(B_MAIN_SCREEN_ID), + fEventQueueLock("input server event queue"), + fReplicantMessenger(NULL), fInputMethodWindow(NULL), fInputMethodAware(false), fCursorSem(-1), @@ -273,8 +276,11 @@ InputServer::_InitKeyboardMouseStates() fFrame = fScreen.Frame(); if (fFrame == BRect(0, 0, 0, 0)) - fFrame = BRect(0, 0, 800, 600); - fMousePos = BPoint(fFrame.right / 2, fFrame.bottom / 2); + fFrame = BRect(0, 0, 799, 599); + fMousePos = BPoint((int32)((fFrame.right + 1) / 2), + (int32)((fFrame.bottom + 1) / 2)); + + memset(&fKeyInfo, 0, sizeof(fKeyInfo)); if (_LoadKeymap() != B_OK) _LoadSystemKeymap(); diff --git a/src/servers/input/InputServer.h b/src/servers/input/InputServer.h index 735832c07b..41baf3d903 100644 --- a/src/servers/input/InputServer.h +++ b/src/servers/input/InputServer.h @@ -209,10 +209,7 @@ class InputServer : public BApplication { void _ReleaseInput(BMessage* message); private: - bool fEventLoopRunning; bool fSafeMode; - port_id fEventPort; - uint16 fKeyboardID; BList fInputDeviceList; @@ -251,7 +248,6 @@ class InputServer : public BApplication { #else uint32* fCursorBuffer; #endif - }; extern InputServer* gInputServer;