Documented Mutter API changes after main GSoC goal was reached

A new object, MetaX11Display, was added, and owned by MetaDisplay. It holds X11 specific objects of MetaDisplay, as well MetaScreen. Creating and destroying the object should be possible all the time, anytime. Helper function, meta_get_x11_display (MetaDisplay *) was added to retrieve MetaX11Display object currently owned by MetaDisplay. All public X11 functions referenced below are defined inside meta/meta-x11-display.h

Second new object, MetaWorkspaceManager, was also introduced to hold workspace management parts of MetaScreen, to avoid cluttering MetaDisplay a lot. It is owned by MetaDisplay, and can be retrieved by using meta_display_get_workspace_manager (MetaDisplay *). All public functions referenced below are defined inside meta/meta-workspace-manager.h

MetaScreen, which previously had an instance for all of the screens mutter managed became an single object nowadays, as it only manages one screen. Because of that, MetaScreen was removed, and objects it managed were split between MetaDisplay, MetaX11Display and MetaWorkspaceManager.

- xdisplay, display and screen name, root window and various atoms were moved
  from MetaDisplay and MetaScreen to MetaX11Display. Function
  meta_display_get_xdisplay (MetaDisplay *) was removed and replaced with
  meta_x11_display_get_xdisplay (MetaX11Display *). Also, functions
  meta_screen_get_xroot (MetaScreen *) and meta_screen_get_screen_number (MetaScreen *)
  were removed and replaced with meta_x11_display_get_xroot (MetaX11Display *)
  and meta_x11_display_get_screen_number (MetaX11Display *), respectively.

- meta_error_trap_* (MetaDisplay *) functions were changed to
  meta_x11_error_trap_* (MetaX11Display *), since they contain X11 specific error
  handling, and can make use of X11 specific GDK functions directly. They can
  now be found inside meta-x11-errors.h instead of previously called errors.h.

- X11 extension queries were moved from MetaDisplay to MetaX11Display.
  Functions meta_display_get_xinput_opcode (MetaDisplay *),
  meta_display_has_shape (MetaDisplay *),
  meta_display_get_damage_event_base (MetaDisplay *) and
  meta_display_get_shape_event_base (MetaDisplay *) were removed and replaced
  with meta_x11_display_get_xinput_opcode (MetaX11Display *),
  meta_x11_display_get_damage_event_base (MetaX11Display *),
  meta_x11_display_get_shape_event_base (MetaX11Display *) and
  meta_x11_display_has_shape (MetaX11Display *), respectively.

- Monitor handling and cursor functionality was moved from MetaScreen to
  MetaDisplay. "cursor-updated" signal was moved from MetaScreen to
  MetaDisplay. "monitors-changed" signal from MetaScreen was removed entirely,
  and "monitors-changed" signal from MetaMonitorManager should be used
  instead. Functions meta_screen_get_size (MetaScreen *, int, int) and
  meta_screen_set_cursor (MetaScreen *, MetaCursor) were removed and replaced
  with meta_display_get_size (MetaDisplay *, int, int) and
  meta_display_set_cursor (MetaDisplay *, MetaCursor). meta_display_get_size ()
  wraps MetaMonitorManager, so it can be used in "monitors-changed" signal

- Alarm filters, group hooks, window hooks and xids tracking, along with their
  private functions were moved moved from MetaDisplay to MetaX11Display.

- Stack tracking was moved moved from MetaScreen to MetaDisplay, along with its
  private functions. X11 guard window was moved from MetaScreen to MetaX11Display,
  along with its private functions.

- Various X11 helper windows were moved from MetaDisplay and MetaScreen
  to MetaX11Display. X11 event handling code, as well as X11 property
  reading helpers were changed to use MetaX11Display. Functions
  meta_display_xwindow_is_a_no_focus_window (MetaDisplay *, Window),
  meta_display_set_input_focus_window (MetaDisplay *, MetaWindow *, gboolean, guint32)
  meta_display_focus_the_no_focus_window (MetaDisplay *, MetaScreen *, guint32 *)
  were removed and replaced with
  meta_x11_display_xwindow_is_a_no_focus_window (MetaX11Display *, Window),
  meta_x11_display_set_input_focus_window (MetaX11Display *, MetaWindow *, gboolean, guint32)
  meta_x11_display_focus_the_no_focus_window (MetaX11Display *, guint32 *), respectively.
  Also, function meta_screen_set_cm_selection (MetaScreen *) was removed and
  replaced with meta_x11_display_set_cm_selection (MetaX11Display *).

- Startup sequences, fullscreen and workarea managing code, along with their
  private functions were moved from MetaScreen to MetaDisplay. Signals
  "window-entered-monitor", "window-left-monitor", "in-fullscreen-changed",
  "startup-sequence-changed" and  "workareas-changed" signals were moved
  from MetaScreen to MetaDisplay. Function
  meta_screen_get_startup_sequences (MetaScreen *) was removed and replaced
  with meta_display_get_startup_sequences (MetaDisplay *).

- Various monitor information functions were moved from MetaScreen
  to MetaDisplay. MetaScreenDirection type was renamed to MetaDisplayDirection.
  Functions meta_screen_get_n_monitors (MetaScreen *),
  meta_screen_get_primary_monitor (MetaScreen *),
  meta_screen_get_current_monitor (MetaScreen *),
  meta_screen_get_monitor_geometry (MetaScreen *screen, int, MetaRectangle *),
  meta_screen_get_monitor_in_fullscreen (MetaScreen *, int),
  meta_screen_get_monitor_index_for_rect (MetaScreen *, MetaRectangle *) and
  meta_screen_get_monitor_neighbor_index (MetaScreen *, int, MetaScreenDirection)
  were removed and replaced with meta_display_get_n_monitors (MetaDisplay *),
  meta_display_get_primary_monitor (MetaDisplay *),
  meta_display_get_current_monitor (MetaDisplay *),
  meta_display_get_monitor_geometry (MetaDisplay *display, int, MetaRectangle *),
  meta_display_get_monitor_in_fullscreen (MetaDisplay *, int),
  meta_display_get_monitor_index_for_rect (MetaDisplay *, MetaRectangle *) and
  meta_display_get_monitor_neighbor_index (MetaDisplay *, int, MetaDisplayDirection).

- Keybindings and MetaUI management were moved from MetaScreen to MetaX11Display.

- Workspace managing code was moved to MetaWorkspaceManager, which is owned by MetaDisplay.
  X11 specific bits are set using signal handlers connected to MetaWorkspaceManager.
  Two new signals were added for that very purpose: "active-workspace-changed" and
  "showing-desktop-changed". Signals "workspace-added", "workspace-removed" and
  "workspace-switched" were moved from MetaScreen to MetaWorkspaceManager. MetaScreenCorner
  type was renamed to MetaDisplayCorner. Publicly available functions
  meta_screen_get_workspaces (MetaScreen *),
  meta_screen_get_n_workspaces (MetaScreen *),
  meta_screen_get_workspace_by_index (MetaScreen *screen, int),
  meta_screen_remove_workspace (MetaScreen *, MetaWorkspace *, guint32),
  meta_screen_append_new_workspace (MetaScreen *, gboolean, guint32),
  meta_screen_get_active_workspace_index (MetaScreen *),
  meta_screen_get_active_workspace (MetaScreen *) and
  void meta_screen_focus_default_window (MetaScreen *, guint32)
  were removed and replaced with
  meta_workspace_manager_get_workspaces (MetaWorkspaceManager *),
  meta_workspace_manager_get_n_workspaces (MetaWorkspaceManager *),
  meta_workspace_manager_get_workspace_by_index (MetaWorkspaceManager *screen, int),
  meta_workspace_manager_remove_workspace (MetaWorkspaceManager *, MetaWorkspace *, guint32),
  meta_workspace_manager_append_new_workspace (MetaWorkspaceManager *, gboolean, guint32),
  meta_workspace_manager_get_active_workspace_index (MetaWorkspaceManager *),
  meta_workspace_manager_get_active_workspace (MetaWorkspaceManager *) and
  meta_display_focus_default_window (MetaDisplay *, guint32).

- The following function was removed entirely
  meta_display_unmanage_screen (MetaDisplay *, MetaScreen *, guint32)

- The following publicly exposed functions
  meta_get_stage_for_screen (MetaScreen *),
  meta_get_overlay_window (MetaScreen *),
  meta_get_window_actors (MetaScreen *),
  meta_get_window_group_for_screen (MetaScreen *),
  meta_get_top_window_group_for_screen (MetaScreen *),
  meta_get_feedback_group_for_screen (MetaScreen *),
  meta_disable_unredirect_for_screen (MetaScreen *),
  meta_enable_unredirect_for_screen (MetaScreen *),
  meta_set_stage_input_region (MetaScreen *, XserverRegion),
  meta_empty_stage_input_region (MetaScreen *),
  meta_focus_stage_window (MetaScreen *, guint32),
  meta_stage_is_focused (MetaScreen *),
  meta_compositor_flash_screen (MetaCompositor *, MetaScreen *),
  meta_background_actor_new  (MetaScreen *, int),
  meta_background_new (MetaScreen *),
  meta_cursor_tracker_get_for_screen (MetaScreen *) and
  meta_plugin_get_screen (MetaPlugin *plugin), were removed and
  replaced with meta_get_stage_for_display (MetaDisplay *),
  meta_get_overlay_window (MetaDisplay *),
  meta_get_window_actors (MetaDisplay *),
  meta_get_window_group_for_display (MetaDisplay *),
  meta_get_top_window_group_for_display (MetaDisplay *),
  meta_get_feedback_group_for_display (MetaDisplay *),
  meta_disable_unredirect_for_display (MetaDisplay *),
  meta_enable_unredirect_for_display (MetaDisplay *),
  meta_set_stage_input_region (MetaDisplay *, XserverRegion),
  meta_empty_stage_input_region (MetaDisplay *),
  meta_focus_stage_window (MetaDisplay *, guint32),
  meta_stage_is_focused (MetaDisplay *),
  meta_compositor_flash_display (MetaCompositor *, MetaDisplay *),
  meta_background_actor_new (MetaDisplay *, int),
  meta_background_new (MetaDisplay *),
  meta_cursor_tracker_get_for_display (MetaDisplay *) and
  meta_plugin_get_display (MetaPlugin *plugin).

- Two new signals have been added to notify an user when X11 gets available
  or is going to be destroyed. "x11-display-opened" and "x11-display-close"
  are part of MetaDisplay.

- When running under Wayland session, meta_display_get_current_time_roundtrip ()
  will now return time from g_get_monotonic_time (), rather than making
  a roundtrip to X server.

- Bell, stack tracker, workarea hint setting and libstartup-notification code
  was made to work without X11 present using signal handlers.

- Default X11 display, previously retrieved from GDK, is now explicitly set
  from DISPLAY variable and opened using GDK function. GTK initialization is
  now split into into separete GDK and GTK initialization, and MetaX11Display
  now tracks GdkDisplay that was opened using DISPLAY env var. Restart helper
  initialization is now done inside meta_x11_display_new (). Some private
  functions from MetaUI were removed, and replaced with meta_x11_display_*

- gtk-shell-shows-app-menu GTK setting changes are no longer honored
  by mutter. This is a consequence of previous paragraph, where GTK
  initialization was moved way after this was initialized. A simple function,
  meta_prefs_set_show_fallback_app_menu (gboolean) was added to
  accommodate for this, and can be called in addition or instead of
  changing the mentioned GTK setting.

- A new --no-x11 flag was added to mutter, which regulates whether
  Xwayland should be started at startup, and whether MetaX11Display
  should be initialized at startup. It can be only used in combination
  with --wayland flag.


Popular posts from this blog

The GSoC wrap-up

Progress Report July 31st - August 13th