Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(490)

Issue 219743002: x11: Move X event handling out of the message-pump. (Closed)

Created:
6 years, 8 months ago by sadrul
Modified:
6 years, 8 months ago
CC:
chromium-reviews, yusukes+watch_chromium.org, viettrungluu+watch_chromium.org, browser-components-watch_chromium.org, dcheng, yukishiino+watch_chromium.org, ben+aura_chromium.org, ben+mojo_chromium.org, extensions-reviews_chromium.org, stevenjb+watch_chromium.org, jam, abarth-chromium, nona+watch_chromium.org, darin-cc_chromium.org, chromium-apps-reviews_chromium.org, erikwright+watch_chromium.org, penghuang+watch_chromium.org, oshima+watch_chromium.org, kalyank, ben+views_chromium.org, jochen+watch_chromium.org, tfarina, Aaron Boodman, darin (slow to review), James Su, ben+ash_chromium.org
Visibility:
Public.

Description

x11: Move X event handling out of the message-pump. This change moves the X11 event handling out of the X11 message-pump, and uses the X11 event dispatch code from X11EventSource instead. Overview of the changes: * Remove all X event handling code from the message-pump. The X11 message-pump only opens the connection to the X11 server. This too will be moved out of here in subsequent patches. * The X11EventSource sends an XEvent it receives from the X11 server back to the X11 message-pump, which triggers the MessagePumpObservers, before sending the event to the dispatchers. This is a short-term workaround until the message-pump observers are converted into PlatformEventObservers. * The MessagePumpDispatcher implementations that deal with X11 events are converted into PlatformEventDispatchers. * Remove support for starting a nested message-loop with a custom dispatcher on non-Windows. Changes in components: //ash: * Split AcceleratorDispatcher into platform-specific AcceleratorDispatcherWin, which remains a MessagePumpDispatcher, and AcceleratorDispatcherLinux, which is a PlatformEventDispatcher. It may be possible to do some cleanup in this, depending on the outcome of http://crbug.com/357777 and http://crbug.com/357733. //base: * Remove support for providing a custom MessagePumpDispatcher when starting a nested message-loop on non-Windows platforms. * Remove most of the event-dispatch code from MessagePumpX11. The only remaining bits are for triggering MessagePumpObservers, which will be replaced by the newer PlatformEventObservers in subsequent patches. //chrome, //content, //mojo, //ui/aura, //ui/base, //ui/wm: * Convert MessagePumpDispatchers that deal with X11 events into PlatformEventDispatchers. //ui/events: * Allow creating a 'default' PlatformEventSource. On X11, it creates X11EventSource, and on other platforms, it doesn't create an event-source. * A temporary measure in X11EventSource to send the event to the message-pump so that the message-pump observers can be triggered. This will be removed once the MessagePumpObservers that deal with X11 events are turned into PlatformEventObservers. //ui/views: * Remove the linux implementation of MenuMessagePumpDispatcher, and replace it with MenuEventDispatcherLinux. * Platform specific implementation for MenuController::RunMessageLoop(): the Windows implementation uses the MessagePumpDispatcher, and the non-windows implementation uses the PlatformEventDispatcher. This is somewhat unfortunate, and I am going to look for something better for this. But the code duplication here is relatively small, I don't want to make this patch any larger. BUG=354062 R=darin@chromium.org, sky@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=262008

Patch Set 1 #

Patch Set 2 : self-nits #

Total comments: 4

Patch Set 3 : . #

Patch Set 4 : . #

Patch Set 5 : . #

Patch Set 6 : tot-merge #

Patch Set 7 : tot-merge-r261267 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+715 lines, -658 lines) Patch
M ash/accelerators/accelerator_dispatcher.h View 2 chunks +29 lines, -8 lines 0 comments Download
M ash/accelerators/accelerator_dispatcher.cc View 3 chunks +26 lines, -67 lines 0 comments Download
A ash/accelerators/accelerator_dispatcher_linux.cc View 1 chunk +90 lines, -0 lines 0 comments Download
A ash/accelerators/accelerator_dispatcher_win.cc View 1 chunk +64 lines, -0 lines 0 comments Download
M ash/accelerators/nested_dispatcher_controller.h View 2 chunks +3 lines, -0 lines 0 comments Download
M ash/accelerators/nested_dispatcher_controller.cc View 1 chunk +8 lines, -4 lines 0 comments Download
M ash/accelerators/nested_dispatcher_controller_unittest.cc View 1 2 4 chunks +21 lines, -8 lines 0 comments Download
M ash/ash.gyp View 1 chunk +2 lines, -0 lines 0 comments Download
M base/message_loop/message_loop.cc View 1 chunk +1 line, -1 line 0 comments Download
M base/message_loop/message_pump_x11.h View 3 chunks +2 lines, -61 lines 0 comments Download
M base/message_loop/message_pump_x11.cc View 5 chunks +8 lines, -237 lines 0 comments Download
M base/run_loop.h View 2 chunks +2 lines, -2 lines 0 comments Download
M base/run_loop.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/bookmarks/bookmark_node_data_unittest.cc View 4 4 chunks +4 lines, -0 lines 0 comments Download
M chrome/browser/extensions/global_shortcut_listener_x11.h View 2 chunks +9 lines, -7 lines 0 comments Download
M chrome/browser/extensions/global_shortcut_listener_x11.cc View 3 chunks +13 lines, -7 lines 0 comments Download
M chrome/browser/ui/views/bookmarks/bookmark_context_menu_unittest.cc View 3 chunks +4 lines, -0 lines 0 comments Download
M mojo/services/native_viewport/native_viewport_x11.cc View 4 chunks +16 lines, -19 lines 0 comments Download
M ui/aura/window_tree_host_x11.h View 2 chunks +6 lines, -5 lines 0 comments Download
M ui/aura/window_tree_host_x11.cc View 8 chunks +19 lines, -14 lines 0 comments Download
M ui/aura/window_tree_host_x11_unittest.cc View 8 chunks +16 lines, -16 lines 0 comments Download
M ui/base/clipboard/clipboard_aurax11.cc View 5 chunks +14 lines, -7 lines 0 comments Download
M ui/base/clipboard/clipboard_unittest.cc View 3 chunks +13 lines, -0 lines 0 comments Download
M ui/base/dragdrop/os_exchange_data_provider_aurax11.h View 3 chunks +5 lines, -3 lines 0 comments Download
M ui/base/dragdrop/os_exchange_data_provider_aurax11.cc View 1 4 chunks +12 lines, -8 lines 0 comments Download
M ui/base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc View 3 chunks +3 lines, -1 line 0 comments Download
M ui/base/dragdrop/os_exchange_data_unittest.cc View 1 chunk +6 lines, -0 lines 0 comments Download
M ui/display/chromeos/x11/DEPS View 1 chunk +1 line, -0 lines 0 comments Download
M ui/display/chromeos/x11/native_display_delegate_x11.h View 1 chunk +1 line, -1 line 0 comments Download
M ui/display/chromeos/x11/native_display_delegate_x11.cc View 3 chunks +10 lines, -5 lines 0 comments Download
M ui/display/chromeos/x11/native_display_event_dispatcher_x11.h View 1 chunk +9 lines, -10 lines 0 comments Download
M ui/display/chromeos/x11/native_display_event_dispatcher_x11.cc View 4 chunks +15 lines, -8 lines 0 comments Download
M ui/display/chromeos/x11/native_display_event_dispatcher_x11_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M ui/events/events.gyp View 1 2 3 4 5 6 2 chunks +4 lines, -0 lines 0 comments Download
M ui/events/platform/platform_event_source.h View 1 chunk +2 lines, -0 lines 0 comments Download
A + ui/events/platform/platform_event_source_stub.cc View 1 chunk +3 lines, -7 lines 0 comments Download
M ui/events/platform/x11/x11_event_source.cc View 2 chunks +15 lines, -1 line 0 comments Download
M ui/views/controls/menu/menu_controller.h View 1 5 chunks +6 lines, -0 lines 0 comments Download
M ui/views/controls/menu/menu_controller.cc View 1 2 6 chunks +34 lines, -1 line 0 comments Download
A ui/views/controls/menu/menu_event_dispatcher_linux.h View 1 chunk +32 lines, -0 lines 0 comments Download
A + ui/views/controls/menu/menu_event_dispatcher_linux.cc View 3 chunks +19 lines, -10 lines 0 comments Download
D ui/views/controls/menu/menu_message_pump_dispatcher.h View 1 chunk +0 lines, -36 lines 0 comments Download
D ui/views/controls/menu/menu_message_pump_dispatcher.cc View 1 chunk +0 lines, -16 lines 0 comments Download
A + ui/views/controls/menu/menu_message_pump_dispatcher_win.h View 2 chunks +3 lines, -3 lines 0 comments Download
M ui/views/controls/menu/menu_message_pump_dispatcher_win.cc View 2 chunks +6 lines, -1 line 0 comments Download
M ui/views/corewm/tooltip_controller_unittest.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/views.gyp View 1 chunk +3 lines, -3 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_dispatcher_client.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc View 1 6 chunks +17 lines, -11 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_screen_x11.h View 3 chunks +5 lines, -4 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_screen_x11.cc View 1 5 chunks +14 lines, -5 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_screen_x11_unittest.cc View 1 2 4 chunks +17 lines, -8 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h View 3 chunks +9 lines, -7 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc View 1 2 3 4 5 5 chunks +19 lines, -6 lines 0 comments Download
M ui/views/widget/desktop_aura/x11_desktop_handler.h View 3 chunks +6 lines, -5 lines 0 comments Download
M ui/views/widget/desktop_aura/x11_desktop_handler.cc View 1 7 chunks +20 lines, -12 lines 0 comments Download
M ui/views/widget/desktop_aura/x11_whole_screen_move_loop.h View 2 chunks +5 lines, -4 lines 0 comments Download
M ui/views/widget/desktop_aura/x11_whole_screen_move_loop.cc View 7 chunks +13 lines, -10 lines 0 comments Download
M ui/wm/DEPS View 1 chunk +1 line, -0 lines 0 comments Download
M ui/wm/core/wm_state.h View 1 2 2 chunks +5 lines, -0 lines 0 comments Download
M ui/wm/core/wm_state.cc View 1 2 2 chunks +3 lines, -0 lines 0 comments Download
M ui/wm/test/wm_test_helper.h View 2 chunks +6 lines, -3 lines 0 comments Download
M ui/wm/test/wm_test_helper.cc View 2 chunks +2 lines, -0 lines 0 comments Download
M ui/wm/wm.gyp View 1 2 3 4 5 6 3 chunks +4 lines, -2 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
sadrul
Hi. Sorry about the large size of the patch. I tried to split it into ...
6 years, 8 months ago (2014-03-31 18:21:09 UTC) #1
sky
Only thing keeping me from approving is is if some setup should be promoted to ...
6 years, 8 months ago (2014-03-31 20:57:28 UTC) #2
sadrul
On 2014/03/31 20:57:28, sky wrote: > Only thing keeping me from approving is is if ...
6 years, 8 months ago (2014-03-31 21:09:54 UTC) #3
sky
I like just doing it. That way everyone doesn't have to think about this. Also, ...
6 years, 8 months ago (2014-03-31 21:41:56 UTC) #4
sadrul
https://codereview.chromium.org/219743002/diff/20001/ash/wm/ash_native_cursor_manager_interactive_uitest.cc File ash/wm/ash_native_cursor_manager_interactive_uitest.cc (right): https://codereview.chromium.org/219743002/diff/20001/ash/wm/ash_native_cursor_manager_interactive_uitest.cc#newcode39 ash/wm/ash_native_cursor_manager_interactive_uitest.cc:39: event_source_ = ui::PlatformEventSource::CreateDefault(); On 2014/03/31 20:57:28, sky wrote: > ...
6 years, 8 months ago (2014-03-31 23:30:15 UTC) #5
sky
LGTM
6 years, 8 months ago (2014-03-31 23:37:36 UTC) #6
sadrul
Thanks! +darin@ for changes in base/
6 years, 8 months ago (2014-03-31 23:40:09 UTC) #7
sadrul
> +darin@ for changes in base/ ping
6 years, 8 months ago (2014-04-01 20:18:30 UTC) #8
darin (slow to review)
base/ LGTM
6 years, 8 months ago (2014-04-05 05:40:37 UTC) #9
darin (slow to review)
base/ LGTM
6 years, 8 months ago (2014-04-05 05:40:40 UTC) #10
sadrul
6 years, 8 months ago (2014-04-05 15:24:10 UTC) #11
Message was sent while issue was closed.
Committed patchset #7 manually as r262008 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698