Compare commits

..

No commits in common. "84c3e0baf10050315325da97f85199e0d02d5eb2" and "54230d76e656f87ccbc2cb344350afa02918ae61" have entirely different histories.

54
wlopm.c
View File

@ -16,6 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include <ctype.h>
#include <errno.h>
#include <signal.h>
#include <stdbool.h>
@ -92,6 +93,8 @@ struct zwlr_output_power_manager_v1 *wlr_output_power_manager = NULL;
int ret = EXIT_SUCCESS;
bool loop = true;
static void noop () {}
static void wlr_output_power_handle_mode (void *data, struct zwlr_output_power_v1 *wlr_output_power,
enum zwlr_output_power_v1_mode mode)
{
@ -119,43 +122,13 @@ static void wl_output_handle_name (void *data, struct wl_output *wl_output,
output->name = strdup(name);
}
static void wl_output_handle_geometry (void *data, struct wl_output *wl_output,
int32_t x, int32_t y, int32_t physical_width, int32_t physical_height,
int32_t subpixel, const char* make, const char* model, int32_t transform)
{
/* This function is deliberately left empty. */
}
static void wl_output_handle_mode (void *data, struct wl_output *wl_output,
uint32_t flags, int32_t width, int32_t height, int32_t refresh)
{
/* This function is deliberately left empty. */
}
static void wl_output_handle_scale (void *data, struct wl_output *wl_output,
int32_t scale)
{
/* This function is deliberately left empty. */
}
static void wl_output_handle_description (void *data, struct wl_output *wl_output,
const char *description)
{
/* This function is deliberately left empty. */
}
static void wl_output_handle_done (void *data, struct wl_output *wl_output)
{
/* This function is deliberately left empty. */
}
static const struct wl_output_listener wl_output_listener = {
.name = wl_output_handle_name,
.geometry = wl_output_handle_geometry,
.mode = wl_output_handle_mode,
.scale = wl_output_handle_scale,
.description = wl_output_handle_description,
.done = wl_output_handle_done,
.geometry = noop,
.mode = noop,
.scale = noop,
.description = noop,
.done = noop,
};
static void registry_handle_global (void *data, struct wl_registry *registry,
@ -178,7 +151,7 @@ static void registry_handle_global (void *data, struct wl_registry *registry,
return;
}
output->wl_output = wl_registry_bind(registry, name,
output->wl_output = wl_registry_bind(registry, name,
&wl_output_interface, 4);
wl_output_add_listener(output->wl_output, &wl_output_listener, output);
output->wlr_output_power = NULL;
@ -192,15 +165,9 @@ static void registry_handle_global (void *data, struct wl_registry *registry,
&zwlr_output_power_manager_v1_interface, version);
}
static void registry_handle_global_remove (void *data, struct wl_registry *registry,
uint32_t name)
{
/* We don't run long enough to care. */
}
static const struct wl_registry_listener registry_listener = {
.global = registry_handle_global,
.global_remove = registry_handle_global_remove,
.global_remove = noop, /* We don't run long enough to care. */
};
static void sync_handle_done (void *data, struct wl_callback *wl_callback, uint32_t other_data);
@ -603,3 +570,4 @@ int main(int argc, char *argv[])
return ret;
}