Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "SWT/Devel/Gtk/Wayland"

< SWT‎ | Devel‎ | Gtk
(Created page with "= Wayland Development = * Wayland development starting guide Wayland [https://en.wikipedia.org/wiki/Wayland_(display_server_protocol) (wiki)] is a...")
 
(Wayland Development)
 
Line 1: Line 1:
 
= Wayland Development =
 
= Wayland Development =
* [[SWT/Devel/Gtk/Wayland | Wayland development starting guide]]
 
 
Wayland [https://en.wikipedia.org/wiki/Wayland_(display_server_protocol) (wiki)] is a rendering engine, intended to be a replacement for X Window System [https://en.wikipedia.org/wiki/X_Window_System (wiki)].
 
Wayland [https://en.wikipedia.org/wiki/Wayland_(display_server_protocol) (wiki)] is a rendering engine, intended to be a replacement for X Window System [https://en.wikipedia.org/wiki/X_Window_System (wiki)].
  
=== Launching Wayland ===
+
== Launching Wayland ==
 
In Fedora 21+, you can run things on Wayland. There are several ways:
 
In Fedora 21+, you can run things on Wayland. There are several ways:
  
=== Log into GNOME Wayland ===
+
== Log into GNOME Wayland ==
 
Log out and then on the logon screen, click on the gear icon and select "Gnome Wayland". [http://fedoramagazine.org/wp-content/uploads/2014/10/gdm-wayland.png  See example screenshot]. At the time of writing (2015.07.21) things like drag and drop and copy and paste did not work. So using Gnome-Wayland full time is difficult.
 
Log out and then on the logon screen, click on the gear icon and select "Gnome Wayland". [http://fedoramagazine.org/wp-content/uploads/2014/10/gdm-wayland.png  See example screenshot]. At the time of writing (2015.07.21) things like drag and drop and copy and paste did not work. So using Gnome-Wayland full time is difficult.
  
=== Launch Gnome Wayland in other Virtual Console ===
+
== Launch Gnome Wayland in other Virtual Console ==
 
Alternatively, you can press Ctl+Alt+F3 etc.. to launch a [https://en.wikipedia.org/wiki/Virtual_Console virtual console].  
 
Alternatively, you can press Ctl+Alt+F3 etc.. to launch a [https://en.wikipedia.org/wiki/Virtual_Console virtual console].  
 
You login with your own user. Then run Gnome Wayland via:   
 
You login with your own user. Then run Gnome Wayland via:   
Line 15: Line 14:
 
     gnome-session --session gnome-wayland
 
     gnome-session --session gnome-wayland
  
=== Kill unresponsive Wayland session ===
+
== Kill unresponsive Wayland session ==
 
You may find sometimes that Wayland with GNOME becomes unresponsive. In this case, switch back to your original virtual terminal (using Ctlr + Alt + F[1,2,3,4...]).
 
You may find sometimes that Wayland with GNOME becomes unresponsive. In this case, switch back to your original virtual terminal (using Ctlr + Alt + F[1,2,3,4...]).
  
Line 33: Line 32:
 
Note: to kill the process you may/may not need to use sudo.
 
Note: to kill the process you may/may not need to use sudo.
  
=== How to identify if your app runs on Wayland as backend ===
+
== How to identify if your app runs on Wayland as backend ==
 
Wayland has a notion of XWayland. This is so that you can run Gtk2 apps on Wayland.
 
Wayland has a notion of XWayland. This is so that you can run Gtk2 apps on Wayland.
 
Since Wayland and X applications look almost the same, it's tricky to tell them appart.
 
Since Wayland and X applications look almost the same, it's tricky to tell them appart.

Latest revision as of 15:13, 30 May 2016

Wayland Development

Wayland (wiki) is a rendering engine, intended to be a replacement for X Window System (wiki).

Launching Wayland

In Fedora 21+, you can run things on Wayland. There are several ways:

Log into GNOME Wayland

Log out and then on the logon screen, click on the gear icon and select "Gnome Wayland". See example screenshot. At the time of writing (2015.07.21) things like drag and drop and copy and paste did not work. So using Gnome-Wayland full time is difficult.

Launch Gnome Wayland in other Virtual Console

Alternatively, you can press Ctl+Alt+F3 etc.. to launch a virtual console. You login with your own user. Then run Gnome Wayland via:

   gnome-session --session gnome-wayland

Kill unresponsive Wayland session

You may find sometimes that Wayland with GNOME becomes unresponsive. In this case, switch back to your original virtual terminal (using Ctlr + Alt + F[1,2,3,4...]).

Running the following command will give you the PID of the process that needs to be killed in order to end the GNOME Wayland session:

  ps aux | grep <TTY_NUMBER> | grep "gnome-session --session gnome-wayland" | grep -v dbus | awk '{print $2}'                # where <TTY_NUMBER> is the tty Wayland is running on (i.e. tty[1,2,3,4...])

You can then kill it using:

 sudo kill PID               # where PID is the PID of process found from the step above

To make this a bit easier I have written a script that does this all in one step.

 export PID="$(ps aux | grep $1 | grep "gnome-session --session gnome-wayland" | grep -v dbus | awk '{print $2}')"
 kill $PID

Simply run the script using:

 kill_gnome_wayland <TTY_NUMBER>            # where <TTY_NUMBER> is the tty Wayland is running on (i.e. tty[1,2,3,4...])

Note: to kill the process you may/may not need to use sudo.

How to identify if your app runs on Wayland as backend

Wayland has a notion of XWayland. This is so that you can run Gtk2 apps on Wayland. Since Wayland and X applications look almost the same, it's tricky to tell them appart.

There are several ways to tell.

  • Launch Gtk Inspector. Under "General" tab, look under "Gdk Backend".
  • Launch looking glass "lg", top left click on "Windows" Tab, then click on one of the appliactions in the list, inspect 'Gtype'. E.g
           Gtype:MetaWindowX11          # X11
           Gtype:MetaWindowWayland      # Wayland

Back to the top