mirror of
https://github.com/wizbright/waybox.git
synced 2025-10-29 05:40:20 -04:00
commit
114e265eef
14 changed files with 66 additions and 399 deletions
|
|
@ -1,8 +1,8 @@
|
|||
# waybox
|
||||
An openbox clone on Wayland (WIP)
|
||||
# Waybox
|
||||
An Openbox clone on Wayland (WIP)
|
||||
|
||||
### 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
|
||||
|
||||
|
|
@ -24,7 +24,7 @@ cd build
|
|||
ninja
|
||||
```
|
||||
|
||||
After that, you should have an executable in build/
|
||||
After that, you should have an executable as waybox/waybox
|
||||
|
||||
### Contact
|
||||
I can be found as wiz on Rizon and WizBright on Freenode.
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#define OUTPUT_H
|
||||
|
||||
#ifndef _POSIX_C_SOURCE
|
||||
#define _POSIX_C_SOURCE 200809L
|
||||
#define _POSIX_C_SOURCE 200112L
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
#ifndef SERVER_H
|
||||
#define SERVER_H
|
||||
|
||||
#ifdef _POSIX_C_SOURCE
|
||||
#undef _POSIX_C_SOURCE
|
||||
#endif
|
||||
#ifndef _POSIX_C_SOURCE
|
||||
#define _POSIX_C_SOURCE 200112L
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
|
@ -17,7 +16,7 @@
|
|||
#include <wlr/types/wlr_screencopy_v1.h>
|
||||
#include <wlr/types/wlr_matrix.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_xdg_shell.h>
|
||||
|
||||
|
|
@ -50,8 +49,8 @@ struct wb_server {
|
|||
struct wl_list outputs; // wb_output::link
|
||||
};
|
||||
|
||||
bool init_wb(struct wb_server* server);
|
||||
bool start_wb(struct wb_server* server);
|
||||
bool terminate_wb(struct wb_server* server);
|
||||
bool wb_create_backend(struct wb_server* server);
|
||||
bool wb_start_server(struct wb_server* server);
|
||||
bool wb_terminate(struct wb_server* server);
|
||||
|
||||
#endif // server.h
|
||||
|
|
|
|||
27
meson.build
27
meson.build
|
|
@ -1,5 +1,3 @@
|
|||
# SirCmpwn is a god. (from mcwayface and bspwc)
|
||||
|
||||
project(
|
||||
'waybox',
|
||||
'c',
|
||||
|
|
@ -13,28 +11,21 @@ project(
|
|||
],
|
||||
)
|
||||
|
||||
add_project_arguments('-Wno-unused-parameter', language: 'c')
|
||||
add_project_arguments('-DWLR_USE_UNSTABLE', language: 'c')
|
||||
add_project_arguments('-DVERSION="' + meson.project_version() + '"', language: 'c')
|
||||
add_project_arguments(
|
||||
'-Wno-unused-parameter',
|
||||
'-DWLR_USE_UNSTABLE',
|
||||
'-DPACKAGE_NAME="' + meson.project_name() + '"',
|
||||
'-DPACKAGE_VERSION="' + meson.project_version() + '"',
|
||||
language: '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
|
||||
inc_dir = include_directories('include')
|
||||
|
||||
pixman = dependency('pixman-1')
|
||||
wlroots = dependency('wlroots', version: '>=0.6.0')
|
||||
wayland_server = dependency('wayland-server')
|
||||
wayland_client = dependency('wayland-client')
|
||||
wayland_protos = dependency('wayland-protocols', version: '>=1.12')
|
||||
wlroots = dependency('wlroots', version: '>=0.9.0')
|
||||
wayland_server = dependency('wayland-server', version: '>=1.15')
|
||||
wayland_protos = dependency('wayland-protocols', version: '>=1.17')
|
||||
xkbcommon = dependency('xkbcommon')
|
||||
|
||||
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_server = generator(
|
||||
wayland_scanner,
|
||||
output: '@BASENAME@-protocol.h',
|
||||
arguments: ['server-header', '@INPUT@', '@OUTPUT@'],
|
||||
wayland_scanner,
|
||||
output: '@BASENAME@-protocol.h',
|
||||
arguments: ['server-header', '@INPUT@', '@OUTPUT@'],
|
||||
)
|
||||
|
||||
wayland_scanner_code = generator(
|
||||
wayland_scanner,
|
||||
output: '@BASENAME@-protocol.c',
|
||||
arguments: ['code', '@INPUT@', '@OUTPUT@'],
|
||||
wayland_scanner,
|
||||
output: '@BASENAME@-protocol.c',
|
||||
arguments: ['private-code', '@INPUT@', '@OUTPUT@'],
|
||||
)
|
||||
|
||||
wayland_scanner_client = generator(
|
||||
wayland_scanner,
|
||||
output: '@BASENAME@-client-protocol.h',
|
||||
arguments: ['client-header', '@INPUT@', '@OUTPUT@'],
|
||||
wayland_scanner,
|
||||
output: '@BASENAME@-client-protocol.h',
|
||||
arguments: ['client-header', '@INPUT@', '@OUTPUT@'],
|
||||
)
|
||||
|
||||
protocols = [
|
||||
[wl_protocol_dir, 'stable/xdg-shell/xdg-shell.xml'],
|
||||
[wl_protocol_dir, 'unstable/idle-inhibit/idle-inhibit-unstable-v1.xml'],
|
||||
[wl_protocol_dir, 'unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml'],
|
||||
'wlr-gamma-control-unstable-v1.xml',
|
||||
'gtk-primary-selection.xml',
|
||||
'idle.xml',
|
||||
'wlr-screencopy-unstable-v1.xml',
|
||||
'server-decoration.xml',
|
||||
'wlr-layer-shell-unstable-v1.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/linux-dmabuf/linux-dmabuf-unstable-v1.xml'],
|
||||
[wl_protocol_dir, 'unstable/primary-selection/primary-selection-unstable-v1.xml'],
|
||||
[wl_protocol_dir, 'unstable/xdg-decoration/xdg-decoration-unstable-v1.xml'],
|
||||
'wlr-gamma-control-unstable-v1.xml',
|
||||
'idle.xml',
|
||||
'wlr-screencopy-unstable-v1.xml',
|
||||
'wlr-layer-shell-unstable-v1.xml',
|
||||
]
|
||||
|
||||
client_protocols = [
|
||||
[wl_protocol_dir, 'stable/xdg-shell/xdg-shell.xml'],
|
||||
[wl_protocol_dir, 'unstable/idle-inhibit/idle-inhibit-unstable-v1.xml'],
|
||||
'idle.xml',
|
||||
'wlr-screencopy-unstable-v1.xml',
|
||||
'wlr-layer-shell-unstable-v1.xml',
|
||||
[wl_protocol_dir, 'stable/xdg-shell/xdg-shell.xml'],
|
||||
[wl_protocol_dir, 'unstable/idle-inhibit/idle-inhibit-unstable-v1.xml'],
|
||||
'idle.xml',
|
||||
'wlr-screencopy-unstable-v1.xml',
|
||||
'wlr-layer-shell-unstable-v1.xml',
|
||||
]
|
||||
|
||||
wl_protos_src = []
|
||||
wl_protos_headers = []
|
||||
|
||||
foreach p : protocols
|
||||
xml = join_paths(p)
|
||||
wl_protos_src += wayland_scanner_code.process(xml)
|
||||
wl_protos_headers += wayland_scanner_server.process(xml)
|
||||
xml = join_paths(p)
|
||||
wl_protos_src += wayland_scanner_code.process(xml)
|
||||
wl_protos_headers += wayland_scanner_server.process(xml)
|
||||
endforeach
|
||||
|
||||
foreach p : client_protocols
|
||||
xml = join_paths(p)
|
||||
wl_protos_headers += wayland_scanner_client.process(xml)
|
||||
xml = join_paths(p)
|
||||
wl_protos_headers += wayland_scanner_client.process(xml)
|
||||
endforeach
|
||||
|
||||
lib_wl_protos = static_library('wl_protos', wl_protos_src + wl_protos_headers,
|
||||
dependencies: [wayland_client]) # for the include directory
|
||||
dependencies: [wayland_server]) # for the include directory
|
||||
|
||||
wlr_protos = declare_dependency(
|
||||
link_with: lib_wl_protos,
|
||||
sources: wl_protos_headers,
|
||||
link_with: lib_wl_protos,
|
||||
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,8 @@ struct wb_cursor *wb_cursor_create(struct wb_server *server) {
|
|||
cursor->server = server;
|
||||
|
||||
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);
|
||||
|
||||
cursor->cursor_motion.notify = handle_cursor_motion;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ int main(int argc, char **argv) {
|
|||
} else if ((!strcmp("--startup", argv[i]) || !strcmp("-s", argv[i])) && i < argc) {
|
||||
startup_cmd = argv[i + 1];
|
||||
} else if (!strcmp("--version", argv[i]) || !strcmp("-V", argv[i])) {
|
||||
printf(VERSION "\n");
|
||||
printf(PACKAGE_NAME " " PACKAGE_VERSION "\n");
|
||||
return 0;
|
||||
} else if (argv[i][0] == '-') {
|
||||
printf("Usage: %s [--debug] [--exit] [--help] [--startup CMD] [--version]\n", argv[0]);
|
||||
|
|
@ -26,26 +26,26 @@ int main(int argc, char **argv) {
|
|||
|
||||
struct wb_server server = {0};
|
||||
|
||||
if (init_wb(&server) == false) {
|
||||
if (!wb_create_backend(&server)) {
|
||||
printf("Failed to create backend\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (!start_wb(&server)) {
|
||||
if (!wb_start_server(&server)) {
|
||||
printf("Failed to start server\n");
|
||||
terminate_wb(&server);
|
||||
wb_terminate(&server);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (startup_cmd) {
|
||||
if (fork() == 0) {
|
||||
execl("/bin/sh", "/bin/sh", "-c", startup_cmd, NULL);
|
||||
execl("/bin/sh", "/bin/sh", "-c", startup_cmd, (char *) NULL);
|
||||
}
|
||||
}
|
||||
|
||||
wl_display_run(server.wl_display);
|
||||
|
||||
terminate_wb(&server);
|
||||
wb_terminate(&server);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ wb_src = files(
|
|||
wb_dep = [
|
||||
wayland_server,
|
||||
wlroots,
|
||||
pixman,
|
||||
xkbcommon,
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
#include <wlr/version.h>
|
||||
|
||||
#include "waybox/output.h"
|
||||
|
||||
struct render_data {
|
||||
|
|
@ -127,12 +125,9 @@ void new_output_notify(struct wl_listener *listener, void *data) {
|
|||
wlr_output_set_mode(wlr_output, mode);
|
||||
wlr_output_enable(wlr_output, true);
|
||||
|
||||
#if WLR_VERSION_NUM > 2049
|
||||
// wlroots 0.9.0+
|
||||
if (!wlr_output_commit(wlr_output)) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
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);
|
||||
} else if (modifiers & WLR_MODIFIER_ALT && sym == XKB_KEY_F2) {
|
||||
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 {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#include "waybox/server.h"
|
||||
#include "waybox/xdg_shell.h"
|
||||
|
||||
bool init_wb(struct wb_server* server) {
|
||||
bool wb_create_backend(struct wb_server* server) {
|
||||
// create display
|
||||
server->wl_display = wl_display_create();
|
||||
if (server->wl_display == NULL) {
|
||||
|
|
@ -27,7 +27,7 @@ bool init_wb(struct wb_server* server) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool start_wb(struct wb_server* server) {
|
||||
bool wb_start_server(struct wb_server* server) {
|
||||
wl_list_init(&server->outputs);
|
||||
|
||||
server->new_output.notify = new_output_notify;
|
||||
|
|
@ -51,7 +51,7 @@ bool start_wb(struct wb_server* server) {
|
|||
|
||||
wlr_gamma_control_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_data_device_manager_create(server->wl_display);
|
||||
|
|
@ -61,7 +61,7 @@ bool start_wb(struct wb_server* server) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool terminate_wb(struct wb_server* server) {
|
||||
bool wb_terminate(struct wb_server* server) {
|
||||
wl_display_destroy_clients(server->wl_display);
|
||||
wb_cursor_destroy(server->cursor);
|
||||
wb_seat_destroy(server->seat);
|
||||
|
|
|
|||
|
|
@ -57,7 +57,8 @@ static void xdg_surface_unmap(struct wl_listener *listener, void *data) {
|
|||
focus_view(current_view, current_view->xdg_surface->surface);
|
||||
}
|
||||
/* Otherwise, focus the next view, if any. */
|
||||
else if (next_view->xdg_surface->surface && wlr_surface_is_xdg_surface(next_view->xdg_surface->surface)) {
|
||||
else if (next_view->xdg_surface->surface &&
|
||||
wlr_surface_is_xdg_surface(next_view->xdg_surface->surface)) {
|
||||
focus_view(next_view, next_view->xdg_surface->surface);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue