avoid pulling the event out of the queue and putting it right back when typing.. working on linux performance bug 26502 r=beard

This commit is contained in:
pavlov%netscape.com 2000-08-09 05:16:17 +00:00
Родитель a8d7c5fa7e
Коммит accfc88901
1 изменённых файлов: 7 добавлений и 8 удалений

Просмотреть файл

@ -25,7 +25,6 @@
#include "nsWindow.h"
#include "nsScrollbar.h"
#include "nsIFileWidget.h"
#include "nsGUIEvent.h"
#include "nsTextWidget.h"
@ -676,19 +675,19 @@ gint handle_key_release_event(GtkObject *w, GdkEventKey* event, gpointer p)
// the next event in the queue is a key press event and it has the
// exact same timestamp as the current event.
// get the next event
nextEvent = gdk_event_get();
// get a copy of the next event
nextEvent = gdk_event_peek();
// see if it's a key press event and if the time matches.
if (nextEvent && (nextEvent->type == GDK_KEY_PRESS) && (nextEvent->key.time == event->time))
if (nextEvent)
{
if ((nextEvent->type == GDK_KEY_PRESS) && (nextEvent->key.time == event->time))
{
shouldDrop = PR_TRUE;
// the next key press event shouldn't generate a key down event.
// this is a global variable
suppressNextKeyDown = PR_TRUE;
}
if (nextEvent) {
// put makes a copy so we're safe doing this.
gdk_event_put(nextEvent);
// free the event since we just got a copy.
gdk_event_free(nextEvent);
}