Ticket #141: InputServer.cpp.2.patch
File InputServer.cpp.2.patch, 2.3 KB (added by , 19 years ago) |
---|
-
haiku/src/servers/input/InputServer.cpp
old new 1476 1476 PRINT(("SanitizeEvents: %lx, %lx\n", fKeyInfo.modifiers, 1477 1477 fKeyInfo.key_states[KEY_Spacebar >> 3])); 1478 1478 1479 int8 byte; 1479 1480 if ((fKeyInfo.modifiers & B_COMMAND_KEY) != 0 1480 && (fKeyInfo.key_states[KEY_Spacebar >> 3] 1481 & (1 << (7 - (KEY_Spacebar % 8))))) { 1481 && event->FindInt8("byte", &byte) == B_OK && byte == ' ') { 1482 1482 SetNextMethod(!fKeyInfo.modifiers & B_SHIFT_KEY); 1483 1483 1484 1484 // this event isn't sent to the user … … 1526 1526 1527 1527 if (!fInputMethodAware) { 1528 1528 // special handling for non-input-method-aware views 1529 for (int32 i = count; i < newCount; i++) {1529 for (int32 i = 0; i < newCount; i++) { 1530 1530 BMessage* event = events.ItemAt(i); 1531 1531 1532 1532 if (event->what != B_INPUT_METHOD_EVENT) … … 1536 1536 1537 1537 int32 opcode; 1538 1538 if (event->FindInt32("be:opcode", &opcode) == B_OK) { 1539 if (fInputMethodWindow && opcode == B_INPUT_METHOD_STOPPED) {1540 fInputMethodWindow->PostMessage(B_QUIT_REQUESTED);1541 fInputMethodWindow = NULL;1542 continue;1543 }1544 1539 if (fInputMethodWindow == NULL 1545 1540 && opcode == B_INPUT_METHOD_STARTED) 1546 1541 fInputMethodWindow = new (nothrow) BottomlineWindow(); 1547 }1548 1542 1549 if (fInputMethodWindow != NULL) { 1550 EventList newEvents; 1551 fInputMethodWindow->HandleInputMethodEvent(event, newEvents); 1552 1553 if (!newEvents.IsEmpty()) { 1554 fInputMethodWindow->PostMessage(B_QUIT_REQUESTED); 1555 fInputMethodWindow = NULL; 1543 if (fInputMethodWindow != NULL) { 1544 EventList newEvents; 1545 fInputMethodWindow->HandleInputMethodEvent(event, newEvents); 1556 1546 1557 1547 // replace event with new events (but don't scan them again 1558 1548 // for input method messages) 1559 events.RemoveItemAt(i );1549 events.RemoveItemAt(i--); 1560 1550 delete event; 1551 newCount--; 1561 1552 1562 events.AddList(&newEvents, i); 1563 i += newEvents.CountItems() - 1; 1564 newCount = events.CountItems(); 1553 if (!newEvents.IsEmpty()) { 1554 events.AddList(&newEvents); 1555 opcode = B_INPUT_METHOD_STOPPED; 1556 } 1557 1558 if (opcode == B_INPUT_METHOD_STOPPED) { 1559 fInputMethodWindow->PostMessage(B_QUIT_REQUESTED); 1560 fInputMethodWindow = NULL; 1561 } 1565 1562 } 1566 1563 } 1567 1564 }