[haiku-commits] haiku: hrev56198 - in src: add-ons/kernel/bus_managers/ps2 preferences/input kits/interface servers/input

  • From: waddlesplash <waddlesplash@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 20 Jun 2022 02:48:09 +0000 (UTC)

hrev56198 adds 4 changesets to branch 'master'
old head: 774c33c2a7010dc5bfa180c45a68040640142a03
new head: a3d84aba733ef5cc4df54fd52d8aa69c39cf9cc3
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=a3d84aba733e+%5E774c33c2a701

----------------------------------------------------------------------------

3f18d506fa8d: Input preferences: remove dead code
  
  The old keyboard preferences used to save its window position in the
  keyboard_settings file. The new Input preferences does not, but part of
  the code had not been removed yet so it would still open the file (and
  then do nothing with it)
  
  Change-Id: Ic5e1d6bd6a8452bd779dc73872148d5c32ab12e5
  Reviewed-on: https://review.haiku-os.org/c/haiku/+/5383
  Tested-by: Commit checker robot <no-reply+buildbot@xxxxxxxxxxxx>
  Reviewed-by: waddlesplash <waddlesplash@xxxxxxxxx>

81f9c26a709c: Input server: remove some dead code
  
  This does nothing, keep the TODO but remove the useless code.
  
  Change-Id: I14611289e1153e406ff7dec93729bceedef7d9af
  Reviewed-on: https://review.haiku-os.org/c/haiku/+/5384
  Tested-by: Commit checker robot <no-reply+buildbot@xxxxxxxxxxxx>
  Reviewed-by: waddlesplash <waddlesplash@xxxxxxxxx>

d2837c97b70f: Interface kit: allow get_key_repeat_{rate,delay} to fail
  
  These functions should return an error if the input_server is not
  running. They still give the default value in this case, but they now
  return an error code.
  
  Change-Id: I706cded7c780d913d4f36164596b2b7794db6f22
  Reviewed-on: https://review.haiku-os.org/c/haiku/+/5385
  Tested-by: Commit checker robot <no-reply+buildbot@xxxxxxxxxxxx>
  Reviewed-by: waddlesplash <waddlesplash@xxxxxxxxx>

a3d84aba733e: ps2: improve tracing
  
  Change-Id: I3991e1974ac4af2ba00d692284bfcf00e5b4cc84
  Reviewed-on: https://review.haiku-os.org/c/haiku/+/5386
  Tested-by: Commit checker robot <no-reply+buildbot@xxxxxxxxxxxx>
  Reviewed-by: waddlesplash <waddlesplash@xxxxxxxxx>

                                   [ PulkoMandy <pulkomandy@xxxxxxxxxxxxx> ]

----------------------------------------------------------------------------

7 files changed, 25 insertions(+), 43 deletions(-)
src/add-ons/kernel/bus_managers/ps2/ps2_alps.cpp |  2 +-
src/add-ons/kernel/bus_managers/ps2/ps2_dev.cpp  | 14 ++++++-------
.../kernel/bus_managers/ps2/ps2_elantech.cpp     |  2 +-
.../kernel/bus_managers/ps2/ps2_synaptics.cpp    |  2 +-
src/kits/interface/InterfaceDefs.cpp             | 18 ++++++++++++----
src/preferences/input/KeyboardSettings.cpp       | 22 --------------------
src/servers/input/InputServer.cpp                |  8 +------

############################################################################

Commit:      3f18d506fa8d9084615c964a0e787d4613b937d0
URL:         https://git.haiku-os.org/haiku/commit/?id=3f18d506fa8d
Author:      PulkoMandy <pulkomandy@xxxxxxxxxxxxx>
Date:        Sat Jun 18 18:45:36 2022 UTC
Committer:   waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Mon Jun 20 02:48:03 2022 UTC

Input preferences: remove dead code

The old keyboard preferences used to save its window position in the
keyboard_settings file. The new Input preferences does not, but part of
the code had not been removed yet so it would still open the file (and
then do nothing with it)

Change-Id: Ic5e1d6bd6a8452bd779dc73872148d5c32ab12e5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5383
Tested-by: Commit checker robot <no-reply+buildbot@xxxxxxxxxxxx>
Reviewed-by: waddlesplash <waddlesplash@xxxxxxxxx>

----------------------------------------------------------------------------

diff --git a/src/preferences/input/KeyboardSettings.cpp 
b/src/preferences/input/KeyboardSettings.cpp
index 84b7eb696e..1c99f3f6cf 100644
--- a/src/preferences/input/KeyboardSettings.cpp
+++ b/src/preferences/input/KeyboardSettings.cpp
@@ -26,33 +26,11 @@ KeyboardSettings::KeyboardSettings()
                fSettings.key_repeat_delay = kb_default_key_repeat_delay;
 
        fOriginalSettings = fSettings;
-
-       BPath path;
-       BFile file;
-
-       status_t status = find_directory(B_USER_SETTINGS_DIRECTORY, &path);
-       if (status == B_OK) {
-               status = path.Append(kb_settings_file);
-               if (status == B_OK)
-                       status = file.SetTo(path.Path(), B_READ_ONLY);
-       }
 }
 
 
 KeyboardSettings::~KeyboardSettings()
 {
-       BPath path;
-       BFile file;
-
-       if (find_directory(B_USER_SETTINGS_DIRECTORY, &path) < B_OK)
-               return;
-
-       if (path.Append(kb_settings_file) < B_OK)
-               return;
-
-       // be careful: don't create the file if it doesn't already exist
-       if (file.SetTo(path.Path(), B_WRITE_ONLY) < B_OK)
-               return;
 }
 
 

############################################################################

Commit:      81f9c26a709cab5d00da2f65016c5071f211704c
URL:         https://git.haiku-os.org/haiku/commit/?id=81f9c26a709c
Author:      PulkoMandy <pulkomandy@xxxxxxxxxxxxx>
Date:        Sat Jun 18 18:46:43 2022 UTC
Committer:   waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Mon Jun 20 02:48:03 2022 UTC

Input server: remove some dead code

This does nothing, keep the TODO but remove the useless code.

Change-Id: I14611289e1153e406ff7dec93729bceedef7d9af
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5384
Tested-by: Commit checker robot <no-reply+buildbot@xxxxxxxxxxxx>
Reviewed-by: waddlesplash <waddlesplash@xxxxxxxxx>

----------------------------------------------------------------------------

diff --git a/src/servers/input/InputServer.cpp 
b/src/servers/input/InputServer.cpp
index 6013cac81f..ca39b83271 100644
--- a/src/servers/input/InputServer.cpp
+++ b/src/servers/input/InputServer.cpp
@@ -577,14 +577,8 @@ InputServer::MessageReceived(BMessage* message)
 
                case B_SOME_APP_LAUNCHED:
                {
-                       const char *signature;
+                       // The message contains a be:signature with the app 
signature
                        // TODO: what's this for?
-                       if (message->FindString("be:signature", 
&signature)==B_OK) {
-                               PRINT(("input_server : %s\n", signature));
-                               if (strcmp(signature, 
"application/x-vnd.Be-TSKB")==0) {
-
-                               }
-                       }
                        return;
                }
 

############################################################################

Commit:      d2837c97b70f821cd06f6ff955ee6c6ea8380f11
URL:         https://git.haiku-os.org/haiku/commit/?id=d2837c97b70f
Author:      PulkoMandy <pulkomandy@xxxxxxxxxxxxx>
Date:        Sat Jun 18 18:47:21 2022 UTC
Committer:   waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Mon Jun 20 02:48:03 2022 UTC

Interface kit: allow get_key_repeat_{rate,delay} to fail

These functions should return an error if the input_server is not
running. They still give the default value in this case, but they now
return an error code.

Change-Id: I706cded7c780d913d4f36164596b2b7794db6f22
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5385
Tested-by: Commit checker robot <no-reply+buildbot@xxxxxxxxxxxx>
Reviewed-by: waddlesplash <waddlesplash@xxxxxxxxx>

----------------------------------------------------------------------------

diff --git a/src/kits/interface/InterfaceDefs.cpp 
b/src/kits/interface/InterfaceDefs.cpp
index 8882089621..b76f86440a 100644
--- a/src/kits/interface/InterfaceDefs.cpp
+++ b/src/kits/interface/InterfaceDefs.cpp
@@ -716,10 +716,15 @@ get_key_repeat_rate(int32 *rate)
        BMessage command(IS_GET_KEY_REPEAT_RATE);
        BMessage reply;
 
-       _control_input_server_(&command, &reply);
+       status_t err = _control_input_server_(&command, &reply);
+
+       if (err == B_OK)
+               err = reply.FindInt32("rate", rate);
 
-       if (reply.FindInt32("rate", rate) != B_OK)
+       if (err != B_OK) {
                *rate = 250000;
+               return err;
+       }
 
        return B_OK;
 }
@@ -741,10 +746,15 @@ get_key_repeat_delay(bigtime_t *delay)
        BMessage command(IS_GET_KEY_REPEAT_DELAY);
        BMessage reply;
 
-       _control_input_server_(&command, &reply);
+       status_t err = _control_input_server_(&command, &reply);
+
+       if (err == B_OK)
+               err = reply.FindInt64("delay", delay);
 
-       if (reply.FindInt64("delay", delay) != B_OK)
+       if (err != B_OK) {
                *delay = 200;
+               return err;
+       }
 
        return B_OK;
 }

############################################################################

Revision:    hrev56198
Commit:      a3d84aba733ef5cc4df54fd52d8aa69c39cf9cc3
URL:         https://git.haiku-os.org/haiku/commit/?id=a3d84aba733e
Author:      PulkoMandy <pulkomandy@xxxxxxxxxxxxx>
Date:        Sat Jun 18 18:50:20 2022 UTC
Committer:   waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Mon Jun 20 02:48:03 2022 UTC

ps2: improve tracing

Change-Id: I3991e1974ac4af2ba00d692284bfcf00e5b4cc84
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5386
Tested-by: Commit checker robot <no-reply+buildbot@xxxxxxxxxxxx>
Reviewed-by: waddlesplash <waddlesplash@xxxxxxxxx>

----------------------------------------------------------------------------

diff --git a/src/add-ons/kernel/bus_managers/ps2/ps2_alps.cpp 
b/src/add-ons/kernel/bus_managers/ps2/ps2_alps.cpp
index 7c9f93c257..81431474c0 100644
--- a/src/add-ons/kernel/bus_managers/ps2/ps2_alps.cpp
+++ b/src/add-ons/kernel/bus_managers/ps2/ps2_alps.cpp
@@ -500,7 +500,7 @@ alps_close(void *_cookie)
        // without a complete shutdown.
        status_t status = ps2_reset_mouse(cookie->dev);
        if (status != B_OK) {
-               INFO("ps2: reset failed\n");
+               INFO("ps2_alps: reset failed\n");
                return B_ERROR;
        }
 
diff --git a/src/add-ons/kernel/bus_managers/ps2/ps2_dev.cpp 
b/src/add-ons/kernel/bus_managers/ps2/ps2_dev.cpp
index 4d018580f6..5f2b7ba872 100644
--- a/src/add-ons/kernel/bus_managers/ps2/ps2_dev.cpp
+++ b/src/add-ons/kernel/bus_managers/ps2/ps2_dev.cpp
@@ -72,7 +72,7 @@ ps2_dev_detect_pointing(ps2_dev* dev, device_hooks** hooks)
 {
        status_t status = ps2_reset_mouse(dev);
        if (status != B_OK) {
-               INFO("ps2: reset failed\n");
+               INFO("ps2_dev: reset failed: %s\n", strerror(status));
                return B_ERROR;
        }
 
@@ -376,7 +376,7 @@ standard_command_timeout(ps2_dev* dev, uint8 cmd, const 
uint8* out,
        int out_count, uint8* in, int in_count, bigtime_t timeout)
 {
        status_t res;
-#ifdef TRACE_PS2
+#ifdef TRACE_PS2_DEV
        bigtime_t start;
 #endif
        int32 sem_count;
@@ -436,7 +436,7 @@ standard_command_timeout(ps2_dev* dev, uint8 cmd, const 
uint8* out,
                }
 
                release_sem(gControllerSem);
-#ifdef TRACE_PS2
+#ifdef TRACE_PS2_DEV
                start = system_time();
 #endif
                res = acquire_sem_etc(dev->result_sem, 1, B_RELATIVE_TIMEOUT, 
timeout);
@@ -444,7 +444,7 @@ standard_command_timeout(ps2_dev* dev, uint8 cmd, const 
uint8* out,
                if (res != B_OK)
                        atomic_and(&dev->flags, ~PS2_FLAG_CMD);
 
-#ifdef TRACE_PS2
+#ifdef TRACE_PS2_DEV
                TRACE("ps2: ps2_dev_command wait for ack res 0x%08" B_PRIx32 ", 
"
                        "wait-time %" B_PRId64 "\n", res, system_time() - 
start);
 #endif
@@ -466,7 +466,7 @@ standard_command_timeout(ps2_dev* dev, uint8 cmd, const 
uint8* out,
                if (in_count == 0) {
                        atomic_and(&dev->flags, ~PS2_FLAG_CMD);
                } else {
-#ifdef TRACE_PS2
+#ifdef TRACE_PS2_DEV
                        start = system_time();
 #endif
                        res = acquire_sem_etc(dev->result_sem, 1, 
B_RELATIVE_TIMEOUT,
@@ -482,7 +482,7 @@ standard_command_timeout(ps2_dev* dev, uint8 cmd, const 
uint8* out,
                                res = B_IO_ERROR;
                        }
 
-#ifdef TRACE_PS2
+#ifdef TRACE_PS2_DEV
                        TRACE("ps2: ps2_dev_command wait for input res 0x%08" 
B_PRIx32 ", "
                                "wait-time %" B_PRId64 "\n", res, system_time() 
- start);
                        for (i = 0; i < in_count; i++)
@@ -491,7 +491,7 @@ standard_command_timeout(ps2_dev* dev, uint8 cmd, const 
uint8* out,
                }
        }
 
-       TRACE("ps2: ps2_dev_command result 0x%08" B_PRIx32 "\n", res);
+       TRACE("ps2: ps2_dev_command result: %s\n", strerror(res));
 
        return res;
 }
diff --git a/src/add-ons/kernel/bus_managers/ps2/ps2_elantech.cpp 
b/src/add-ons/kernel/bus_managers/ps2/ps2_elantech.cpp
index 39a748f156..1b6b62b5e4 100644
--- a/src/add-ons/kernel/bus_managers/ps2/ps2_elantech.cpp
+++ b/src/add-ons/kernel/bus_managers/ps2/ps2_elantech.cpp
@@ -683,7 +683,7 @@ elantech_close(void *_cookie)
        // without a complete shutdown.
        status_t status = ps2_reset_mouse(cookie->dev);
        if (status != B_OK) {
-               INFO("ps2: reset failed\n");
+               INFO("ps2_elantech: reset failed\n");
                return B_ERROR;
        }
 
diff --git a/src/add-ons/kernel/bus_managers/ps2/ps2_synaptics.cpp 
b/src/add-ons/kernel/bus_managers/ps2/ps2_synaptics.cpp
index c821b4f3e1..5f4d785143 100644
--- a/src/add-ons/kernel/bus_managers/ps2/ps2_synaptics.cpp
+++ b/src/add-ons/kernel/bus_managers/ps2/ps2_synaptics.cpp
@@ -567,7 +567,7 @@ synaptics_close(void *_cookie)
        // without a complete shutdown.
        status = ps2_reset_mouse(cookie->dev);
        if (status != B_OK) {
-               INFO("ps2: reset failed\n");
+               INFO("ps2_synaptics: reset failed\n");
                return B_ERROR;
        }
 


Other related posts:

  • » [haiku-commits] haiku: hrev56198 - in src: add-ons/kernel/bus_managers/ps2 preferences/input kits/interface servers/input - waddlesplash