[network/kdeconnect-android] src/main/java/org/kde/kdeconnect/plugins/mousepad: Now for real fix "Show keyboard initially"

Albert Vaca Cintora <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 7299d55a1e4aa68e60394c3a839b2de7d7ee1d1d by Albert Vaca Cintora.
Committed on 29/07/2026 at 16:46.
Pushed by albertvaka into branch 'master'.

Now for real fix "Show keyboard initially"

M  +7    -5    src/main/java/org/kde/kdeconnect/plugins/mousepad/MousePadActivity.java

https://invent.kde.org/network/kdeconnect-android/-/commit/7299d55a1e4aa68e60394c3a839b2de7d7ee1d1d

diff --git a/src/main/java/org/kde/kdeconnect/plugins/mousepad/MousePadActivity.java b/src/main/java/org/kde/kdeconnect/plugins/mousepad/MousePadActivity.java
index ce60a377a..ca7eacf8f 100644
--- a/src/main/java/org/kde/kdeconnect/plugins/mousepad/MousePadActivity.java
+++ b/src/main/java/org/kde/kdeconnect/plugins/mousepad/MousePadActivity.java
@@ -167,8 +167,6 @@ public class MousePadActivity
         prefs = PreferenceManager.getDefaultSharedPreferences(this);
         prefs.registerOnSharedPreferenceChangeListener(this);
 
-        applyPrefs();
-
         //Technically xdpi and ydpi should be handled separately,
         //but since ydpi is usually almost equal to xdpi, only xdpi is used for the multiplier.
         displayDpiMultiplier = StandardDpi / getResources().getDisplayMetrics().xdpi;
@@ -186,6 +184,8 @@ public class MousePadActivity
                 getWindow().getDecorView().setSystemUiVisibility(fullscreenType);
             }
         });
+
+        applyPrefs();
     }
 
     @Override
@@ -548,9 +548,11 @@ public class MousePadActivity
     }
 
     private void showKeyboard() {
-        InputMethodManager imm = ContextCompat.getSystemService(this, InputMethodManager.class);
-        keyListenerView.requestFocus();
-        imm.showSoftInput(keyListenerView.getRootView(),0);
+        keyListenerView.post(() -> {
+            InputMethodManager imm = ContextCompat.getSystemService(this, InputMethodManager.class);
+            keyListenerView.requestFocus();
+            imm.showSoftInput(keyListenerView, 0);
+        });
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.