-
-
Notifications
You must be signed in to change notification settings - Fork 574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No keyboard input (v72.1 for Linux / Debian 9 Stretch / KDE 5) #269
Comments
Here is the phpdesktop and cefclient code for creating GTK window. It seems to me that removing the vbox container in GTK 2 might resolve the issue. Please change line 57 to "return window" and rebuild phpdesktop by following the Build on Linux instructions. Use branch "linux72". |
Ok, I've changed line 57 and compiled everything but the bug is still present. diff --git a/src/gtk.cpp b/src/gtk.cpp
index 9e7bafa..356691c 100644
--- a/src/gtk.cpp
+++ b/src/gtk.cpp
@@ -54,7 +54,7 @@ GtkWidget* create_gtk_window(const char* title, const char* icon,
set_window_icon(GTK_WINDOW(window), icon);
gtk_widget_show_all(window);
- return vbox;
+ return window;
} |
Does the issue reproduce on a clean OS? What OS version should I install in virtual machine to reproduce it? |
I was able to reproduce the bug on a clean install of Debian 10 in VirtualBox:
|
I haven't yet tested it on Debian 10. Just wanted to add that other users report it works fine on Ubuntu 18 which is based on Debian 10 buster. Can you test using different desktop environment on Debian, for example with GNOME? |
✔️ Yes, I can confirm that there are no issues on Ubuntu 18. ❌ I have just tested it on a vanilla installation of Debian 10 with GNOME 3.30.2 and the results are negative: the keyboard input does not work. It was necessary to install GTK2 as it wasn't preinstalled. |
Other things to test:
|
I haven't done the extra tests but I noticed something interesting about the cefclient that I built. On start it seems to be fine - I can type in the search form on the google page and I can scroll with the keyboard. But as soon I click in the address bar only the address bar gets the keyboard input:
After some random clicking the address bar appears to lose the connection to the keyboard, but I can no longer type in the form field on the google page, nor can I scroll with the keyboard. And on every 5-10 runs of the cefclient there were cases where the keyboard input was not working completely. |
I just saw that you already filed a bug report about the issue that I mentioned (or something similar): https://bitbucket.org/chromiumembedded/cef/issues/2026/multiple-major-keyboard-focus-issues-on |
I have executed the three steps but the bug was still present. I am not entirely sure though if I've done the things correctly so here are my changes: Changes 1-3diff --git a/src/gtk.cpp b/src/gtk.cpp
index 9e7bafa..2b8e68a 100644
--- a/src/gtk.cpp
+++ b/src/gtk.cpp
@@ -3,6 +3,7 @@
// Project website: https://github.com/cztomczak/phpdesktop
#include "gtk.h"
+#include "util_gtk.h"
#include "client_handler.h"
#include "include/cef_app.h"
@@ -14,6 +15,9 @@ namespace {
GtkWidget* create_gtk_window(const char* title, const char* icon,
bool center, int width, int height) {
+
+ ScopedGdkThreadsEnter scoped_gdk_threads;
+
// Create window.
GtkWidget* window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
g_main_window = window;
@@ -28,6 +32,9 @@ GtkWidget* create_gtk_window(const char* title, const char* icon,
g_signal_connect(G_OBJECT(window), "destroy",
G_CALLBACK(window_destroy_signal), NULL);
+ g_signal_connect(G_OBJECT(window), "configure-event",
+ G_CALLBACK(window_configure_event), NULL);
+
// Default size.
gtk_window_set_default_size(GTK_WINDOW(window),
width, height);
@@ -47,6 +54,8 @@ GtkWidget* create_gtk_window(const char* title, const char* icon,
#else
GtkWidget* vbox = gtk_vbox_new(0, 0);
#endif
+ g_signal_connect(vbox, "size-allocate",
+ G_CALLBACK(window_size_allocate_signal), NULL);
gtk_container_add(GTK_CONTAINER(window), vbox);
// Show.
@@ -122,6 +131,18 @@ void window_destroy_signal(GtkWidget* widget, gpointer data) {
CefQuitMessageLoop();
}
+void window_configure_event(GtkWidget* widget, gpointer data) {
+ // LOG(INFO) << "window_focus_out_signal";
+ ClientHandler *handler = ClientHandler::GetInstance();
+ ::Window window_xid = get_window_xid(widget);
+ ::Window browser_xid = find_child_browser(window_xid);
+ CefRefPtr<CefBrowser> browser = handler->FindBrowserByXid(browser_xid);
+ if (browser_xid && browser.get()) {
+ LOG(INFO) << "window_configure_event: NotifyMoveOrResizeStarted";
+ browser->GetHost()->NotifyMoveOrResizeStarted();
+ }
+}
+
void set_window_icon(GtkWindow* window, const char* icon) {
GError *err = NULL;
GdkPixbuf* pixbuf = gdk_pixbuf_new_from_file(icon, &err);
@@ -182,4 +203,4 @@ void fix_default_x11_visual(GtkWidget* widget) {
}
g_list_free(visuals);
#endif
-}
\ No newline at end of file
+} As for step 4, I have executed the cefclient with the |
Changes look good. But the problem is elsewhere since you can reproduce the issue in cefclient quite easily when controls are hidden. The bitbucket issue provides information on resolving focus issues. It requires patching CEF and making changes to app code to handle focus-in-event, focus-out-event and grab-focus signals. This could be applied without the need to patch CEF. First try to make app changes to focus signals:
If that doesn't help then instead of SendFocusEvent calls do |
In focus-out-event signal don't call |
Or maybe it is required to call |
Hello ! I also have this issue ; spent the day trying to compile the CFE branch with the fix, to no avail. Is there a fix in the works for this repo, or are you waiting for the merge upstream ? |
I don't think this is fixed in CEF. You need to change phpdesktop code that handles focus signals. I've mentioned the X11 functions in an earlier comment. |
Initially posted in the forum
I am testing the linux-v72.0 package without any modifications and it seems that the keyboard input is not working. I cannot type anything in the text fields in forms.php, nor can I scroll long pages using the keyboard (Page Up, Page Down, arrow keys). The developers tools work fine however, so this problem is present only in the main browser window.
Here are my system specifications:
Here is a sample debug output from the console.
I have tested all packages from the linux-v70.0 release to see if the bug is present in any of them:
As per Czarek's request I've built the cefclient from cef_binary_3.3626.1883.g00e6af4_linux64 and it is working fine.
The text was updated successfully, but these errors were encountered: