mirror of
				https://github.com/wizbright/waybox.git
				synced 2025-10-29 05:40:20 -04:00 
			
		
		
		
	Merge branches 'basic-functionality' and 'modernize', remote-tracking branch 'upstream/master'
This commit is contained in:
		
						commit
						ee3cf551d0
					
				
					 12 changed files with 52 additions and 390 deletions
				
			
		|  | @ -1,8 +1,8 @@ | ||||||
| # waybox | # Waybox | ||||||
| An openbox clone on Wayland (WIP) | An Openbox clone on Wayland (WIP) | ||||||
| 
 | 
 | ||||||
| ### Goals | ### Goals | ||||||
| The main goal of this project is to provide a similar feel to openbox but on wayland | The main goal of this project is to provide a similar feel to Openbox but on Wayland | ||||||
| 
 | 
 | ||||||
| ### Contributing | ### Contributing | ||||||
| 
 | 
 | ||||||
|  | @ -24,7 +24,7 @@ cd build | ||||||
| ninja | ninja | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| After that, you should have an executable in build/ | After that, you should have an executable as waybox/waybox | ||||||
| 
 | 
 | ||||||
| ### Contact | ### Contact | ||||||
| I can be found as wiz on Rizon and WizBright on Freenode.  | I can be found as wiz on Rizon and WizBright on Freenode.  | ||||||
|  |  | ||||||
|  | @ -2,18 +2,15 @@ | ||||||
| #define OUTPUT_H | #define OUTPUT_H | ||||||
| 
 | 
 | ||||||
| #ifndef _POSIX_C_SOURCE | #ifndef _POSIX_C_SOURCE | ||||||
| #define _POSIX_C_SOURCE 200809L | #define _POSIX_C_SOURCE 200112L | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #include <assert.h> |  | ||||||
| #include <stdio.h> | #include <stdio.h> | ||||||
| #include <stdlib.h> | #include <stdlib.h> | ||||||
| #include <time.h> | #include <time.h> | ||||||
| 
 | 
 | ||||||
| #include <wlr/backend.h> |  | ||||||
| #include <wlr/render/wlr_renderer.h> | #include <wlr/render/wlr_renderer.h> | ||||||
| #include <wlr/render/wlr_texture.h> | #include <wlr/render/wlr_texture.h> | ||||||
| #include <wlr/types/wlr_compositor.h> |  | ||||||
| 
 | 
 | ||||||
| #include "waybox/server.h" | #include "waybox/server.h" | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,10 +1,9 @@ | ||||||
| #ifndef SERVER_H | #ifndef SERVER_H | ||||||
| #define SERVER_H | #define SERVER_H | ||||||
| 
 | 
 | ||||||
| #ifdef _POSIX_C_SOURCE | #ifndef _POSIX_C_SOURCE | ||||||
| #undef _POSIX_C_SOURCE |  | ||||||
| #endif |  | ||||||
| #define _POSIX_C_SOURCE 200112L | #define _POSIX_C_SOURCE 200112L | ||||||
|  | #endif | ||||||
| 
 | 
 | ||||||
| #include <stdio.h> | #include <stdio.h> | ||||||
| 
 | 
 | ||||||
|  | @ -17,7 +16,7 @@ | ||||||
| #include <wlr/types/wlr_screencopy_v1.h> | #include <wlr/types/wlr_screencopy_v1.h> | ||||||
| #include <wlr/types/wlr_matrix.h> | #include <wlr/types/wlr_matrix.h> | ||||||
| #include <wlr/types/wlr_gamma_control_v1.h> | #include <wlr/types/wlr_gamma_control_v1.h> | ||||||
| #include <wlr/types/wlr_gtk_primary_selection.h> | #include <wlr/types/wlr_primary_selection_v1.h> | ||||||
| #include <wlr/types/wlr_output_layout.h> | #include <wlr/types/wlr_output_layout.h> | ||||||
| #include <wlr/types/wlr_xdg_shell.h> | #include <wlr/types/wlr_xdg_shell.h> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
							
								
								
									
										22
									
								
								meson.build
									
										
									
									
									
								
							
							
						
						
									
										22
									
								
								meson.build
									
										
									
									
									
								
							|  | @ -1,5 +1,3 @@ | ||||||
| # SirCmpwn is a god. (from mcwayface and bspwc) |  | ||||||
| 
 |  | ||||||
| project( | project( | ||||||
|   'waybox', |   'waybox', | ||||||
|   'c', |   'c', | ||||||
|  | @ -13,28 +11,22 @@ project( | ||||||
|   ], |   ], | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| add_project_arguments('-Wno-unused-parameter', language: 'c') | add_project_arguments( | ||||||
| add_project_arguments('-DWLR_USE_UNSTABLE', language: 'c') |   '-Wno-unused-parameter', | ||||||
| add_project_arguments('-DVERSION="' + meson.project_version() + '"', language: 'c') |   '-DWLR_USE_UNSTABLE', | ||||||
|  |   '-DVERSION="' + meson.project_version() + '"', | ||||||
|  |   language: 'c') | ||||||
| 
 | 
 | ||||||
| cc = meson.get_compiler('c') | cc = meson.get_compiler('c') | ||||||
| 
 | 
 | ||||||
| if cc.get_id() == 'clang' |  | ||||||
|   add_project_arguments('-Wno-missing-field-initializers', language: 'c') |  | ||||||
|   add_project_arguments('-Wno-missing-braces', language: 'c') |  | ||||||
| endif |  | ||||||
| 
 |  | ||||||
| # Hide deprecated API |  | ||||||
| add_project_arguments('-DWL_HIDE_DEPRECATED', language: 'c') |  | ||||||
| 
 |  | ||||||
| # Adding include directory | # Adding include directory | ||||||
| inc_dir = include_directories('include') | inc_dir = include_directories('include') | ||||||
| 
 | 
 | ||||||
| pixman = dependency('pixman-1') | pixman = dependency('pixman-1') | ||||||
| wlroots = dependency('wlroots', version: '>=0.6.0') | wlroots = dependency('wlroots', version: '>=0.9.0') | ||||||
| wayland_server = dependency('wayland-server') | wayland_server = dependency('wayland-server') | ||||||
| wayland_client = dependency('wayland-client') | wayland_client = dependency('wayland-client') | ||||||
| wayland_protos  = dependency('wayland-protocols', version: '>=1.12') | wayland_protos  = dependency('wayland-protocols', version: '>=1.17') | ||||||
| xkbcommon  = dependency('xkbcommon') | xkbcommon  = dependency('xkbcommon') | ||||||
| 
 | 
 | ||||||
| subdir('protocol') | subdir('protocol') | ||||||
|  |  | ||||||
|  | @ -1,225 +0,0 @@ | ||||||
| <?xml version="1.0" encoding="UTF-8"?> |  | ||||||
| <protocol name="gtk_primary_selection"> |  | ||||||
|   <copyright> |  | ||||||
|     Copyright © 2015, 2016 Red Hat |  | ||||||
| 
 |  | ||||||
|     Permission is hereby granted, free of charge, to any person obtaining a |  | ||||||
|     copy of this software and associated documentation files (the "Software"), |  | ||||||
|     to deal in the Software without restriction, including without limitation |  | ||||||
|     the rights to use, copy, modify, merge, publish, distribute, sublicense, |  | ||||||
|     and/or sell copies of the Software, and to permit persons to whom the |  | ||||||
|     Software is furnished to do so, subject to the following conditions: |  | ||||||
| 
 |  | ||||||
|     The above copyright notice and this permission notice (including the next |  | ||||||
|     paragraph) shall be included in all copies or substantial portions of the |  | ||||||
|     Software. |  | ||||||
| 
 |  | ||||||
|     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |  | ||||||
|     IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |  | ||||||
|     FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL |  | ||||||
|     THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |  | ||||||
|     LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |  | ||||||
|     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |  | ||||||
|     DEALINGS IN THE SOFTWARE. |  | ||||||
|   </copyright> |  | ||||||
| 
 |  | ||||||
|   <description summary="Primary selection protocol"> |  | ||||||
|     This protocol provides the ability to have a primary selection device to |  | ||||||
|     match that of the X server. This primary selection is a shortcut to the |  | ||||||
|     common clipboard selection, where text just needs to be selected in order |  | ||||||
|     to allow copying it elsewhere. The de facto way to perform this action |  | ||||||
|     is the middle mouse button, although it is not limited to this one. |  | ||||||
| 
 |  | ||||||
|     Clients wishing to honor primary selection should create a primary |  | ||||||
|     selection source and set it as the selection through |  | ||||||
|     wp_primary_selection_device.set_selection whenever the text selection |  | ||||||
|     changes. In order to minimize calls in pointer-driven text selection, |  | ||||||
|     it should happen only once after the operation finished. Similarly, |  | ||||||
|     a NULL source should be set when text is unselected. |  | ||||||
| 
 |  | ||||||
|     wp_primary_selection_offer objects are first announced through the |  | ||||||
|     wp_primary_selection_device.data_offer event. Immediately after this event, |  | ||||||
|     the primary data offer will emit wp_primary_selection_offer.offer events |  | ||||||
|     to let know of the mime types being offered. |  | ||||||
| 
 |  | ||||||
|     When the primary selection changes, the client with the keyboard focus |  | ||||||
|     will receive wp_primary_selection_device.selection events. Only the client |  | ||||||
|     with the keyboard focus will receive such events with a non-NULL |  | ||||||
|     wp_primary_selection_offer. Across keyboard focus changes, previously |  | ||||||
|     focused clients will receive wp_primary_selection_device.events with a |  | ||||||
|     NULL wp_primary_selection_offer. |  | ||||||
| 
 |  | ||||||
|     In order to request the primary selection data, the client must pass |  | ||||||
|     a recent serial pertaining to the press event that is triggering the |  | ||||||
|     operation, if the compositor deems the serial valid and recent, the |  | ||||||
|     wp_primary_selection_source.send event will happen in the other end |  | ||||||
|     to let the transfer begin. The client owning the primary selection |  | ||||||
|     should write the requested data, and close the file descriptor |  | ||||||
|     immediately. |  | ||||||
| 
 |  | ||||||
|     If the primary selection owner client disappeared during the transfer, |  | ||||||
|     the client reading the data will receive a |  | ||||||
|     wp_primary_selection_device.selection event with a NULL |  | ||||||
|     wp_primary_selection_offer, the client should take this as a hint |  | ||||||
|     to finish the reads related to the no longer existing offer. |  | ||||||
| 
 |  | ||||||
|     The primary selection owner should be checking for errors during |  | ||||||
|     writes, merely cancelling the ongoing transfer if any happened. |  | ||||||
|   </description> |  | ||||||
| 
 |  | ||||||
|   <interface name="gtk_primary_selection_device_manager" version="1"> |  | ||||||
|     <description summary="X primary selection emulation"> |  | ||||||
|       The primary selection device manager is a singleton global object that |  | ||||||
|       provides access to the primary selection. It allows to create |  | ||||||
|       wp_primary_selection_source objects, as well as retrieving the per-seat |  | ||||||
|       wp_primary_selection_device objects. |  | ||||||
|     </description> |  | ||||||
| 
 |  | ||||||
|     <request name="create_source"> |  | ||||||
|       <description summary="create a new primary selection source"> |  | ||||||
| 	Create a new primary selection source. |  | ||||||
|       </description> |  | ||||||
|       <arg name="id" type="new_id" interface="gtk_primary_selection_source"/> |  | ||||||
|     </request> |  | ||||||
| 
 |  | ||||||
|     <request name="get_device"> |  | ||||||
|       <description summary="create a new primary selection device"> |  | ||||||
|         Create a new data device for a given seat. |  | ||||||
|       </description> |  | ||||||
|       <arg name="id" type="new_id" interface="gtk_primary_selection_device"/> |  | ||||||
|       <arg name="seat" type="object" interface="wl_seat"/> |  | ||||||
|     </request> |  | ||||||
| 
 |  | ||||||
|     <request name="destroy" type="destructor"> |  | ||||||
|       <description summary="destroy the primary selection device manager"> |  | ||||||
| 	Destroy the primary selection device manager. |  | ||||||
|       </description> |  | ||||||
|     </request> |  | ||||||
|   </interface> |  | ||||||
| 
 |  | ||||||
|   <interface name="gtk_primary_selection_device" version="1"> |  | ||||||
|     <request name="set_selection"> |  | ||||||
|       <description summary="set the primary selection"> |  | ||||||
| 	Replaces the current selection. The previous owner of the primary selection |  | ||||||
| 	will receive a wp_primary_selection_source.cancelled event. |  | ||||||
| 
 |  | ||||||
| 	To unset the selection, set the source to NULL. |  | ||||||
|       </description> |  | ||||||
|       <arg name="source" type="object" interface="gtk_primary_selection_source" allow-null="true"/> |  | ||||||
|       <arg name="serial" type="uint" summary="serial of the event that triggered this request"/> |  | ||||||
|     </request> |  | ||||||
| 
 |  | ||||||
|     <event name="data_offer"> |  | ||||||
|       <description summary="introduce a new wp_primary_selection_offer"> |  | ||||||
| 	Introduces a new wp_primary_selection_offer object that may be used |  | ||||||
| 	to receive the current primary selection. Immediately following this |  | ||||||
| 	event, the new wp_primary_selection_offer object will send |  | ||||||
| 	wp_primary_selection_offer.offer events to describe the offered mime |  | ||||||
| 	types. |  | ||||||
|       </description> |  | ||||||
|       <arg name="offer" type="new_id" interface="gtk_primary_selection_offer"/> |  | ||||||
|     </event> |  | ||||||
| 
 |  | ||||||
|     <event name="selection"> |  | ||||||
|       <description summary="advertise a new primary selection"> |  | ||||||
| 	The wp_primary_selection_device.selection event is sent to notify the |  | ||||||
| 	client of a new primary selection. This event is sent after the |  | ||||||
| 	wp_primary_selection.data_offer event introducing this object, and after |  | ||||||
| 	the offer has announced its mimetypes through |  | ||||||
| 	wp_primary_selection_offer.offer. |  | ||||||
| 
 |  | ||||||
| 	The data_offer is valid until a new offer or NULL is received |  | ||||||
| 	or until the client loses keyboard focus. The client must destroy the |  | ||||||
| 	previous selection data_offer, if any, upon receiving this event. |  | ||||||
|       </description> |  | ||||||
|       <arg name="id" type="object" interface="gtk_primary_selection_offer" allow-null="true"/> |  | ||||||
|     </event> |  | ||||||
| 
 |  | ||||||
|     <request name="destroy" type="destructor"> |  | ||||||
|       <description summary="destroy the primary selection device"> |  | ||||||
| 	Destroy the primary selection device. |  | ||||||
|       </description> |  | ||||||
|     </request> |  | ||||||
|   </interface> |  | ||||||
| 
 |  | ||||||
|   <interface name="gtk_primary_selection_offer" version="1"> |  | ||||||
|     <description summary="offer to transfer primary selection contents"> |  | ||||||
|       A wp_primary_selection_offer represents an offer to transfer the contents |  | ||||||
|       of the primary selection clipboard to the client. Similar to |  | ||||||
|       wl_data_offer, the offer also describes the mime types that the source |  | ||||||
|       will transferthat the |  | ||||||
|       data can be converted to and provides the mechanisms for transferring the |  | ||||||
|       data directly to the client. |  | ||||||
|     </description> |  | ||||||
| 
 |  | ||||||
|     <request name="receive"> |  | ||||||
|       <description summary="request that the data is transferred"> |  | ||||||
| 	To transfer the contents of the primary selection clipboard, the client |  | ||||||
| 	issues this request and indicates the mime type that it wants to |  | ||||||
| 	receive. The transfer happens through the passed file descriptor |  | ||||||
| 	(typically created with the pipe system call). The source client writes |  | ||||||
| 	the data in the mime type representation requested and then closes the |  | ||||||
| 	file descriptor. |  | ||||||
| 
 |  | ||||||
| 	The receiving client reads from the read end of the pipe until EOF and |  | ||||||
| 	closes its end, at which point the transfer is complete. |  | ||||||
|       </description> |  | ||||||
|       <arg name="mime_type" type="string"/> |  | ||||||
|       <arg name="fd" type="fd"/> |  | ||||||
|     </request> |  | ||||||
| 
 |  | ||||||
|     <request name="destroy" type="destructor"> |  | ||||||
|       <description summary="destroy the primary selection offer"> |  | ||||||
| 	Destroy the primary selection offer. |  | ||||||
|       </description> |  | ||||||
|     </request> |  | ||||||
| 
 |  | ||||||
|     <event name="offer"> |  | ||||||
|       <description summary="advertise offered mime type"> |  | ||||||
| 	Sent immediately after creating announcing the wp_primary_selection_offer |  | ||||||
| 	through wp_primary_selection_device.data_offer. One event is sent per |  | ||||||
| 	offered mime type. |  | ||||||
|       </description> |  | ||||||
|       <arg name="mime_type" type="string"/> |  | ||||||
|     </event> |  | ||||||
|   </interface> |  | ||||||
| 
 |  | ||||||
|   <interface name="gtk_primary_selection_source" version="1"> |  | ||||||
|     <description summary="offer to replace the contents of the primary selection"> |  | ||||||
|       The source side of a wp_primary_selection_offer, it provides a way to |  | ||||||
|       describe the offered data and respond to requests to transfer the |  | ||||||
|       requested contents of the primary selection clipboard. |  | ||||||
|     </description> |  | ||||||
| 
 |  | ||||||
|     <request name="offer"> |  | ||||||
|       <description summary="add an offered mime type"> |  | ||||||
| 	This request adds a mime type to the set of mime types advertised to |  | ||||||
| 	targets. Can be called several times to offer multiple types. |  | ||||||
|       </description> |  | ||||||
|       <arg name="mime_type" type="string"/> |  | ||||||
|     </request> |  | ||||||
| 
 |  | ||||||
|     <request name="destroy" type="destructor"> |  | ||||||
|       <description summary="destroy the primary selection source"> |  | ||||||
| 	Destroy the primary selection source. |  | ||||||
|       </description> |  | ||||||
|     </request> |  | ||||||
| 
 |  | ||||||
|     <event name="send"> |  | ||||||
|       <description summary="send the primary selection contents"> |  | ||||||
| 	Request for the current primary selection contents from the client. |  | ||||||
| 	Send the specified mime type over the passed file descriptor, then |  | ||||||
| 	close it. |  | ||||||
|       </description> |  | ||||||
|       <arg name="mime_type" type="string"/> |  | ||||||
|       <arg name="fd" type="fd"/> |  | ||||||
|     </event> |  | ||||||
| 
 |  | ||||||
|     <event name="cancelled"> |  | ||||||
|       <description summary="request for primary selection contents was canceled"> |  | ||||||
| 	This primary selection source is no longer valid. The client should |  | ||||||
| 	clean up and destroy this primary selection source. |  | ||||||
|       </description> |  | ||||||
|     </event> |  | ||||||
|   </interface> |  | ||||||
| </protocol> |  | ||||||
|  | @ -3,61 +3,61 @@ wl_protocol_dir = wayland_protos.get_pkgconfig_variable('pkgdatadir') | ||||||
| wayland_scanner = find_program('wayland-scanner') | wayland_scanner = find_program('wayland-scanner') | ||||||
| 
 | 
 | ||||||
| wayland_scanner_server = generator( | wayland_scanner_server = generator( | ||||||
| 	wayland_scanner, |   wayland_scanner, | ||||||
| 	output: '@BASENAME@-protocol.h', |   output: '@BASENAME@-protocol.h', | ||||||
| 	arguments: ['server-header', '@INPUT@', '@OUTPUT@'], |   arguments: ['server-header', '@INPUT@', '@OUTPUT@'], | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| wayland_scanner_code = generator( | wayland_scanner_code = generator( | ||||||
| 	wayland_scanner, |   wayland_scanner, | ||||||
| 	output: '@BASENAME@-protocol.c', |   output: '@BASENAME@-protocol.c', | ||||||
| 	arguments: ['code', '@INPUT@', '@OUTPUT@'], |   arguments: ['private-code', '@INPUT@', '@OUTPUT@'], | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| wayland_scanner_client = generator( | wayland_scanner_client = generator( | ||||||
| 	wayland_scanner, |   wayland_scanner, | ||||||
| 	output: '@BASENAME@-client-protocol.h', |   output: '@BASENAME@-client-protocol.h', | ||||||
| 	arguments: ['client-header', '@INPUT@', '@OUTPUT@'], |   arguments: ['client-header', '@INPUT@', '@OUTPUT@'], | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| protocols = [ | protocols = [ | ||||||
| 	[wl_protocol_dir, 'stable/xdg-shell/xdg-shell.xml'], |   [wl_protocol_dir, 'stable/xdg-shell/xdg-shell.xml'], | ||||||
| 	[wl_protocol_dir, 'unstable/idle-inhibit/idle-inhibit-unstable-v1.xml'], |   [wl_protocol_dir, 'unstable/idle-inhibit/idle-inhibit-unstable-v1.xml'], | ||||||
| 	[wl_protocol_dir, 'unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml'], |   [wl_protocol_dir, 'unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml'], | ||||||
| 	'wlr-gamma-control-unstable-v1.xml', |   [wl_protocol_dir, 'unstable/primary-selection/primary-selection-unstable-v1.xml'], | ||||||
| 	'gtk-primary-selection.xml', |   [wl_protocol_dir, 'unstable/xdg-decoration/xdg-decoration-unstable-v1.xml'], | ||||||
| 	'idle.xml', |   'wlr-gamma-control-unstable-v1.xml', | ||||||
| 	'wlr-screencopy-unstable-v1.xml', |   'idle.xml', | ||||||
| 	'server-decoration.xml', |   'wlr-screencopy-unstable-v1.xml', | ||||||
| 	'wlr-layer-shell-unstable-v1.xml', |   'wlr-layer-shell-unstable-v1.xml', | ||||||
| ] | ] | ||||||
| 
 | 
 | ||||||
| client_protocols = [ | client_protocols = [ | ||||||
| 	[wl_protocol_dir, 'stable/xdg-shell/xdg-shell.xml'], |   [wl_protocol_dir, 'stable/xdg-shell/xdg-shell.xml'], | ||||||
| 	[wl_protocol_dir, 'unstable/idle-inhibit/idle-inhibit-unstable-v1.xml'], |   [wl_protocol_dir, 'unstable/idle-inhibit/idle-inhibit-unstable-v1.xml'], | ||||||
| 	'idle.xml', |   'idle.xml', | ||||||
| 	'wlr-screencopy-unstable-v1.xml', |   'wlr-screencopy-unstable-v1.xml', | ||||||
| 	'wlr-layer-shell-unstable-v1.xml', |   'wlr-layer-shell-unstable-v1.xml', | ||||||
| ] | ] | ||||||
| 
 | 
 | ||||||
| wl_protos_src = [] | wl_protos_src = [] | ||||||
| wl_protos_headers = [] | wl_protos_headers = [] | ||||||
| 
 | 
 | ||||||
| foreach p : protocols | foreach p : protocols | ||||||
| 	xml = join_paths(p) |   xml = join_paths(p) | ||||||
| 	wl_protos_src += wayland_scanner_code.process(xml) |   wl_protos_src += wayland_scanner_code.process(xml) | ||||||
| 	wl_protos_headers += wayland_scanner_server.process(xml) |   wl_protos_headers += wayland_scanner_server.process(xml) | ||||||
| endforeach | endforeach | ||||||
| 
 | 
 | ||||||
| foreach p : client_protocols | foreach p : client_protocols | ||||||
| 	xml = join_paths(p) |   xml = join_paths(p) | ||||||
| 	wl_protos_headers += wayland_scanner_client.process(xml) |   wl_protos_headers += wayland_scanner_client.process(xml) | ||||||
| endforeach | endforeach | ||||||
| 
 | 
 | ||||||
| lib_wl_protos = static_library('wl_protos', wl_protos_src + wl_protos_headers, | lib_wl_protos = static_library('wl_protos', wl_protos_src + wl_protos_headers, | ||||||
| 	dependencies: [wayland_client]) # for the include directory |   dependencies: [wayland_client]) # for the include directory | ||||||
| 
 | 
 | ||||||
| wlr_protos = declare_dependency( | wlr_protos = declare_dependency( | ||||||
| 	link_with: lib_wl_protos, |   link_with: lib_wl_protos, | ||||||
| 	sources: wl_protos_headers, |   sources: wl_protos_headers, | ||||||
| ) | ) | ||||||
|  |  | ||||||
|  | @ -1,94 +0,0 @@ | ||||||
| <?xml version="1.0" encoding="UTF-8"?> |  | ||||||
| <protocol name="server_decoration"> |  | ||||||
|   <copyright><![CDATA[ |  | ||||||
|     Copyright (C) 2015 Martin Gräßlin |  | ||||||
| 
 |  | ||||||
|     This program is free software: you can redistribute it and/or modify |  | ||||||
|     it under the terms of the GNU Lesser General Public License as published by |  | ||||||
|     the Free Software Foundation, either version 2.1 of the License, or |  | ||||||
|     (at your option) any later version. |  | ||||||
| 
 |  | ||||||
|     This program is distributed in the hope that it will be useful, |  | ||||||
|     but WITHOUT ANY WARRANTY; without even the implied warranty of |  | ||||||
|     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the |  | ||||||
|     GNU Lesser General Public License for more details. |  | ||||||
| 
 |  | ||||||
|     You should have received a copy of the GNU Lesser General Public License |  | ||||||
|     along with this program.  If not, see <http://www.gnu.org/licenses/>. |  | ||||||
|   ]]></copyright> |  | ||||||
|   <interface  name="org_kde_kwin_server_decoration_manager" version="1"> |  | ||||||
|     <description summary="Server side window decoration manager"> |  | ||||||
|       This interface allows to coordinate whether the server should create |  | ||||||
|       a server-side window decoration around a wl_surface representing a |  | ||||||
|       shell surface (wl_shell_surface or similar). By announcing support |  | ||||||
|       for this interface the server indicates that it supports server |  | ||||||
|       side decorations. |  | ||||||
|     </description> |  | ||||||
|     <request name="create"> |  | ||||||
|       <description summary="Create a server-side decoration object for a given surface"> |  | ||||||
|         When a client creates a server-side decoration object it indicates |  | ||||||
|         that it supports the protocol. The client is supposed to tell the |  | ||||||
|         server whether it wants server-side decorations or will provide |  | ||||||
|         client-side decorations. |  | ||||||
| 
 |  | ||||||
|         If the client does not create a server-side decoration object for |  | ||||||
|         a surface the server interprets this as lack of support for this |  | ||||||
|         protocol and considers it as client-side decorated. Nevertheless a |  | ||||||
|         client-side decorated surface should use this protocol to indicate |  | ||||||
|         to the server that it does not want a server-side deco. |  | ||||||
|       </description> |  | ||||||
|       <arg name="id" type="new_id" interface="org_kde_kwin_server_decoration"/> |  | ||||||
|       <arg name="surface" type="object" interface="wl_surface"/> |  | ||||||
|     </request> |  | ||||||
|     <enum name="mode"> |  | ||||||
|       <description summary="Possible values to use in request_mode and the event mode."/> |  | ||||||
|       <entry name="None" value="0" summary="Undecorated: The surface is not decorated at all, neither server nor client-side. An example is a popup surface which should not be decorated."/> |  | ||||||
|       <entry name="Client" value="1" summary="Client-side decoration: The decoration is part of the surface and the client."/> |  | ||||||
|       <entry name="Server" value="2" summary="Server-side decoration: The server embeds the surface into a decoration frame."/> |  | ||||||
|     </enum> |  | ||||||
|     <event name="default_mode"> |  | ||||||
|       <description summary="The default mode used on the server"> |  | ||||||
|         This event is emitted directly after binding the interface. It contains |  | ||||||
|         the default mode for the decoration. When a new server decoration object |  | ||||||
|         is created this new object will be in the default mode until the first |  | ||||||
|         request_mode is requested. |  | ||||||
| 
 |  | ||||||
|         The server may change the default mode at any time. |  | ||||||
|       </description> |  | ||||||
|       <arg name="mode" type="uint" summary="The default decoration mode applied to newly created server decorations."/> |  | ||||||
|     </event> |  | ||||||
|   </interface> |  | ||||||
|   <interface name="org_kde_kwin_server_decoration" version="1"> |  | ||||||
|     <request name="release" type="destructor"> |  | ||||||
|       <description summary="release the server decoration object"/> |  | ||||||
|     </request> |  | ||||||
|     <enum name="mode"> |  | ||||||
|       <description summary="Possible values to use in request_mode and the event mode."/> |  | ||||||
|       <entry name="None" value="0" summary="Undecorated: The surface is not decorated at all, neither server nor client-side. An example is a popup surface which should not be decorated."/> |  | ||||||
|       <entry name="Client" value="1" summary="Client-side decoration: The decoration is part of the surface and the client."/> |  | ||||||
|       <entry name="Server" value="2" summary="Server-side decoration: The server embeds the surface into a decoration frame."/> |  | ||||||
|     </enum> |  | ||||||
|     <request name="request_mode"> |  | ||||||
|       <description summary="The decoration mode the surface wants to use."/> |  | ||||||
|       <arg name="mode" type="uint" summary="The mode this surface wants to use."/> |  | ||||||
|     </request> |  | ||||||
|     <event name="mode"> |  | ||||||
|       <description summary="The new decoration mode applied by the server"> |  | ||||||
|         This event is emitted directly after the decoration is created and |  | ||||||
|         represents the base decoration policy by the server. E.g. a server |  | ||||||
|         which wants all surfaces to be client-side decorated will send Client, |  | ||||||
|         a server which wants server-side decoration will send Server. |  | ||||||
| 
 |  | ||||||
|         The client can request a different mode through the decoration request. |  | ||||||
|         The server will acknowledge this by another event with the same mode. So |  | ||||||
|         even if a server prefers server-side decoration it's possible to force a |  | ||||||
|         client-side decoration. |  | ||||||
| 
 |  | ||||||
|         The server may emit this event at any time. In this case the client can |  | ||||||
|         again request a different mode. It's the responsibility of the server to |  | ||||||
|         prevent a feedback loop. |  | ||||||
|       </description> |  | ||||||
|       <arg name="mode" type="uint" summary="The decoration mode applied to the surface by the server."/> |  | ||||||
|     </event> |  | ||||||
|   </interface> |  | ||||||
| </protocol> |  | ||||||
|  | @ -165,7 +165,7 @@ struct wb_cursor *wb_cursor_create(struct wb_server *server) { | ||||||
| 	cursor->server = server; | 	cursor->server = server; | ||||||
| 
 | 
 | ||||||
| 	const char *xcursor_size = getenv("XCURSOR_SIZE"); | 	const char *xcursor_size = getenv("XCURSOR_SIZE"); | ||||||
| 	cursor->xcursor_manager = wlr_xcursor_manager_create(getenv("XCURSOR_THEME"), xcursor_size ? atoi(xcursor_size) : 24); | 	cursor->xcursor_manager = wlr_xcursor_manager_create(getenv("XCURSOR_THEME"), xcursor_size ? strtoul(xcursor_size, (char **) NULL, 10) : 24); | ||||||
| 	wlr_xcursor_manager_load(cursor->xcursor_manager, 1); | 	wlr_xcursor_manager_load(cursor->xcursor_manager, 1); | ||||||
| 
 | 
 | ||||||
| 	cursor->cursor_motion.notify = handle_cursor_motion; | 	cursor->cursor_motion.notify = handle_cursor_motion; | ||||||
|  |  | ||||||
|  | @ -39,7 +39,7 @@ int main(int argc, char **argv) { | ||||||
| 
 | 
 | ||||||
| 	if (startup_cmd) { | 	if (startup_cmd) { | ||||||
| 		if (fork() == 0) { | 		if (fork() == 0) { | ||||||
| 			execl("/bin/sh", "/bin/sh", "-c", startup_cmd, NULL); | 			execl("/bin/sh", "/bin/sh", "-c", startup_cmd, (char *) NULL); | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,5 +1,3 @@ | ||||||
| #include <wlr/version.h> |  | ||||||
| 
 |  | ||||||
| #include "waybox/output.h" | #include "waybox/output.h" | ||||||
| 
 | 
 | ||||||
| struct render_data { | struct render_data { | ||||||
|  | @ -87,8 +85,7 @@ void output_frame_notify(struct wl_listener *listener, void *data) { | ||||||
| 	wlr_renderer_clear(renderer, color); | 	wlr_renderer_clear(renderer, color); | ||||||
| 
 | 
 | ||||||
| 	struct wb_view *view; | 	struct wb_view *view; | ||||||
| 	wl_list_for_each_reverse(view, &output->server->views, link) | 	wl_list_for_each_reverse(view, &output->server->views, link) { | ||||||
| 	{ |  | ||||||
| 		if (!view->mapped) | 		if (!view->mapped) | ||||||
| 			/* An unmapped view should not be rendered */ | 			/* An unmapped view should not be rendered */ | ||||||
| 			continue; | 			continue; | ||||||
|  | @ -128,12 +125,9 @@ void new_output_notify(struct wl_listener *listener, void *data) { | ||||||
| 		wlr_output_set_mode(wlr_output, mode); | 		wlr_output_set_mode(wlr_output, mode); | ||||||
| 		wlr_output_enable(wlr_output, true); | 		wlr_output_enable(wlr_output, true); | ||||||
| 
 | 
 | ||||||
| #if WLR_VERSION_NUM > 2049 |  | ||||||
| 		// wlroots 0.9.0+
 |  | ||||||
| 		if (!wlr_output_commit(wlr_output)) { | 		if (!wlr_output_commit(wlr_output)) { | ||||||
| 			return; | 			return; | ||||||
| 		} | 		} | ||||||
| #endif |  | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	struct wb_output *output = calloc(1, sizeof(struct wb_output)); | 	struct wb_output *output = calloc(1, sizeof(struct wb_output)); | ||||||
|  |  | ||||||
|  | @ -27,7 +27,7 @@ static bool handle_keybinding(struct wb_server *server, xkb_keysym_t sym, uint32 | ||||||
| 		wl_list_insert(server->views.prev, ¤t_view->link); | 		wl_list_insert(server->views.prev, ¤t_view->link); | ||||||
| 	} else if (modifiers & WLR_MODIFIER_ALT && sym == XKB_KEY_F2) { | 	} else if (modifiers & WLR_MODIFIER_ALT && sym == XKB_KEY_F2) { | ||||||
| 		if (fork() == 0) { | 		if (fork() == 0) { | ||||||
| 			execl("/bin/sh", "/bin/sh", "-c", "(obrun || bemenu-run || synapse || gmrun || gnome-do || dmenu_run) 2>/dev/null", NULL); | 			execl("/bin/sh", "/bin/sh", "-c", "(obrun || bemenu-run || synapse || gmrun || gnome-do || dmenu_run) 2>/dev/null", (char *) NULL); | ||||||
| 		} | 		} | ||||||
| 	} else { | 	} else { | ||||||
| 		return false; | 		return false; | ||||||
|  |  | ||||||
|  | @ -35,8 +35,7 @@ bool start_wb(struct wb_server* server) { | ||||||
| 	wl_signal_add(&server->backend->events.new_output, &server->new_output); | 	wl_signal_add(&server->backend->events.new_output, &server->new_output); | ||||||
| 
 | 
 | ||||||
| 	const char *socket = wl_display_add_socket_auto(server->wl_display); | 	const char *socket = wl_display_add_socket_auto(server->wl_display); | ||||||
| 	if (!socket) | 	if (!socket) { | ||||||
| 	{ |  | ||||||
| 		wlr_backend_destroy(server->backend); | 		wlr_backend_destroy(server->backend); | ||||||
| 		return false; | 		return false; | ||||||
| 	} | 	} | ||||||
|  | @ -53,7 +52,7 @@ bool start_wb(struct wb_server* server) { | ||||||
| 
 | 
 | ||||||
| 	wlr_gamma_control_manager_v1_create(server->wl_display); | 	wlr_gamma_control_manager_v1_create(server->wl_display); | ||||||
| 	wlr_screencopy_manager_v1_create(server->wl_display); | 	wlr_screencopy_manager_v1_create(server->wl_display); | ||||||
| 	wlr_gtk_primary_selection_device_manager_create(server->wl_display); | 	wlr_primary_selection_v1_device_manager_create(server->wl_display); | ||||||
| 	wlr_idle_create(server->wl_display); | 	wlr_idle_create(server->wl_display); | ||||||
| 
 | 
 | ||||||
| 	wlr_data_device_manager_create(server->wl_display); | 	wlr_data_device_manager_create(server->wl_display); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Keith Bowes
						Keith Bowes