+2008-02-08 Pierre-Luc Beaudoin <pierre-luc.beaudoin@collabora.co.uk>
+
+ Reviewed by Alp Toker.
+
+ http://bugs.webkit.org/show_bug.cgi?id=17009
+ [Gtk] Webkit strips accents from some dead-key combinations
+
+ KeyEvents have to go through the gtk input method.
+
+ Also implement the isKeypad check and make disambiguateKeyDownEvent
+ behave more like other ports.
+
+ * platform/PlatformKeyboardEvent.h:
+ * platform/gtk/KeyEventGtk.cpp:
+ (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
+ (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
+ (WebCore::PlatformKeyboardEvent::gdkEventKey):
+
2008-02-08 Darin Adler <darin@apple.com>
Reviewed by Eric.
/*
* Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2008 Collabora, Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
#if PLATFORM(GTK)
PlatformKeyboardEvent(GdkEventKey*);
+ GdkEventKey* gdkEventKey() const;
#endif
#if PLATFORM(QT)
#if PLATFORM(WIN)
bool m_isSystemKey;
#endif
+#if PLATFORM(GTK)
+ GdkEventKey* m_gdkEventKey;
+#endif
};
} // namespace WebCore
* Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
* Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
* Copyright (C) 2007 Holger Hans Peter Freyther
+ * Copyright (C) 2008 Collabora, Ltd. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
return retVal;
}
+// TODO: m_gdkEventKey should be refcounted
PlatformKeyboardEvent::PlatformKeyboardEvent(GdkEventKey* event)
: m_type((event->type == GDK_KEY_RELEASE) ? KeyUp : KeyDown)
, m_text(singleCharacterString(event->keyval))
, m_keyIdentifier(keyIdentifierForGdkKeyCode(event->keyval))
, m_autoRepeat(false)
, m_windowsVirtualKeyCode(windowsKeyCodeForKeyEvent(event->keyval))
- , m_isKeypad(false)
+ , m_isKeypad(event->keyval >= GDK_KP_Space && event->keyval <= GDK_KP_9)
, m_shiftKey((event->state & GDK_SHIFT_MASK) || (event->keyval == GDK_3270_BackTab))
, m_ctrlKey(event->state & GDK_CONTROL_MASK)
, m_altKey(event->state & GDK_MOD1_MASK)
, m_metaKey(event->state & GDK_MOD2_MASK)
+ , m_gdkEventKey(event)
{
}
-void PlatformKeyboardEvent::disambiguateKeyDownEvent(Type type, bool)
+void PlatformKeyboardEvent::disambiguateKeyDownEvent(Type type, bool backwardCompatibilityMode)
{
// Can only change type from KeyDown to RawKeyDown or Char, as we lack information for other conversions.
ASSERT(m_type == KeyDown);
m_type = type;
+ if (backwardCompatibilityMode)
+ return;
+
if (type == RawKeyDown) {
m_text = String();
m_unmodifiedText = String();
return false;
}
+GdkEventKey* PlatformKeyboardEvent::gdkEventKey() const
+{
+ return m_gdkEventKey;
+}
+
}
+2008-02-08 Pierre-Luc Beaudoin <pierre-luc.beaudoin@collabora.co.uk>
+
+ Reviewed by Alp Toker.
+
+ http://bugs.webkit.org/show_bug.cgi?id=17009
+ [Gtk] Webkit strips accents from some dead-key combinations
+
+ KeyEvents have to go through the gtk input method.
+
+ * WebCoreSupport/EditorClientGtk.cpp:
+ (WebKit::imContextCommitted):
+ (WebKit::EditorClient::doTextFieldCommandFromEvent):
+
2008-02-05 Mark Rowe <mrowe@apple.com>
Reviewed by Alp Toker.
static void imContextCommitted(GtkIMContext* context, const char* str, EditorClient* client)
{
Frame* frame = core(client->m_webView)->focusController()->focusedOrMainFrame();
- frame->editor()->insertTextWithoutSendingTextEvent(str, false);
+ frame->editor()->insertTextWithoutSendingTextEvent(String::fromUTF8(str), false);
}
bool EditorClient::shouldDeleteRange(Range*)
notImplemented();
}
-bool EditorClient::doTextFieldCommandFromEvent(Element*, KeyboardEvent*)
+bool EditorClient::doTextFieldCommandFromEvent(Element* element, KeyboardEvent* event)
{
- notImplemented();
- return false;
+ WebKitWebViewPrivate* priv = m_webView->priv;
+ return gtk_im_context_filter_keypress(priv->imContext, event->keyEvent()->gdkEventKey());
}
void EditorClient::textWillBeDeletedInTextField(Element*)