Changeset 30090 in webkit


Ignore:
Timestamp:
Feb 8, 2008 2:41:58 AM (16 years ago)
Author:
alp@webkit.org
Message:

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.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r30089 r30090  
     12008-02-08  Pierre-Luc Beaudoin  <pierre-luc.beaudoin@collabora.co.uk>
     2
     3        Reviewed by Alp Toker.
     4
     5        http://bugs.webkit.org/show_bug.cgi?id=17009
     6        [Gtk] Webkit strips accents from some dead-key combinations
     7
     8        KeyEvents have to go through the gtk input method.
     9
     10        Also implement the isKeypad check and make disambiguateKeyDownEvent
     11        behave more like other ports.
     12
     13        * platform/PlatformKeyboardEvent.h:
     14        * platform/gtk/KeyEventGtk.cpp:
     15        (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
     16        (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
     17        (WebCore::PlatformKeyboardEvent::gdkEventKey):
     18
    1192008-02-08  Darin Adler  <darin@apple.com>
    220
  • trunk/WebCore/platform/PlatformKeyboardEvent.h

    r28693 r30090  
    11/*
    22 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.  All rights reserved.
     3 * Copyright (C) 2008 Collabora, Ltd.  All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    119120#if PLATFORM(GTK)
    120121        PlatformKeyboardEvent(GdkEventKey*);
     122        GdkEventKey* gdkEventKey() const;
    121123#endif
    122124
     
    148150        bool m_isSystemKey;
    149151#endif
     152#if PLATFORM(GTK)
     153        GdkEventKey* m_gdkEventKey;
     154#endif
    150155    };
    151156
  • trunk/WebCore/platform/gtk/KeyEventGtk.cpp

    r29961 r30090  
    33 * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
    44 * Copyright (C) 2007 Holger Hans Peter Freyther
     5 * Copyright (C) 2008 Collabora, Ltd.  All rights reserved.
    56 * All rights reserved.
    67 *
     
    485486}
    486487
     488// TODO: m_gdkEventKey should be refcounted
    487489PlatformKeyboardEvent::PlatformKeyboardEvent(GdkEventKey* event)
    488490    : m_type((event->type == GDK_KEY_RELEASE) ? KeyUp : KeyDown)
     
    492494    , m_autoRepeat(false)
    493495    , m_windowsVirtualKeyCode(windowsKeyCodeForKeyEvent(event->keyval))
    494     , m_isKeypad(false)
     496    , m_isKeypad(event->keyval >= GDK_KP_Space && event->keyval <= GDK_KP_9)
    495497    , m_shiftKey((event->state & GDK_SHIFT_MASK) || (event->keyval == GDK_3270_BackTab))
    496498    , m_ctrlKey(event->state & GDK_CONTROL_MASK)
    497499    , m_altKey(event->state & GDK_MOD1_MASK)
    498500    , m_metaKey(event->state & GDK_MOD2_MASK)
    499 {
    500 }
    501 
    502 void PlatformKeyboardEvent::disambiguateKeyDownEvent(Type type, bool)
     501    , m_gdkEventKey(event)
     502{
     503}
     504
     505void PlatformKeyboardEvent::disambiguateKeyDownEvent(Type type, bool backwardCompatibilityMode)
    503506{
    504507    // Can only change type from KeyDown to RawKeyDown or Char, as we lack information for other conversions.
    505508    ASSERT(m_type == KeyDown);
    506509    m_type = type;
     510
     511    if (backwardCompatibilityMode)
     512        return;
    507513
    508514    if (type == RawKeyDown) {
     
    521527}
    522528
    523 }
     529GdkEventKey* PlatformKeyboardEvent::gdkEventKey() const
     530{
     531    return m_gdkEventKey;
     532}
     533
     534}
  • trunk/WebKit/gtk/ChangeLog

    r30031 r30090  
     12008-02-08  Pierre-Luc Beaudoin  <pierre-luc.beaudoin@collabora.co.uk>
     2
     3        Reviewed by Alp Toker.
     4
     5        http://bugs.webkit.org/show_bug.cgi?id=17009
     6        [Gtk] Webkit strips accents from some dead-key combinations
     7
     8        KeyEvents have to go through the gtk input method.
     9
     10        * WebCoreSupport/EditorClientGtk.cpp:
     11        (WebKit::imContextCommitted):
     12        (WebKit::EditorClient::doTextFieldCommandFromEvent):
     13
    1142008-02-05  Mark Rowe  <mrowe@apple.com>
    215
  • trunk/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp

    r29985 r30090  
    3838{
    3939    Frame* frame = core(client->m_webView)->focusController()->focusedOrMainFrame();
    40     frame->editor()->insertTextWithoutSendingTextEvent(str, false);
     40    frame->editor()->insertTextWithoutSendingTextEvent(String::fromUTF8(str), false);
    4141}
    4242
     
    383383}
    384384
    385 bool EditorClient::doTextFieldCommandFromEvent(Element*, KeyboardEvent*)
    386 {
    387     notImplemented();
    388     return false;
     385bool EditorClient::doTextFieldCommandFromEvent(Element* element, KeyboardEvent* event)
     386{
     387    WebKitWebViewPrivate* priv = m_webView->priv;
     388    return gtk_im_context_filter_keypress(priv->imContext, event->keyEvent()->gdkEventKey());
    389389}
    390390
Note: See TracChangeset for help on using the changeset viewer.