mirror of
				https://github.com/wizbright/waybox.git
				synced 2025-11-03 09:01:45 -05:00 
			
		
		
		
	More debugging messages
This commit is contained in:
		
							parent
							
								
									d19918e482
								
							
						
					
					
						commit
						73460ae133
					
				
					 4 changed files with 14 additions and 7 deletions
				
			
		| 
						 | 
					@ -20,6 +20,7 @@ static void render_surface(struct wlr_surface *surface, int sx, int sy, void *da
 | 
				
			||||||
	 * means. You don't have to worry about this, wlroots takes care of it. */
 | 
						 * means. You don't have to worry about this, wlroots takes care of it. */
 | 
				
			||||||
	struct wlr_texture *texture = wlr_surface_get_texture(surface);
 | 
						struct wlr_texture *texture = wlr_surface_get_texture(surface);
 | 
				
			||||||
	if (texture == NULL) {
 | 
						if (texture == NULL) {
 | 
				
			||||||
 | 
							wlr_log(WLR_ERROR, "%s: %s", _("Couldn't get a surface texture"));
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -75,6 +76,7 @@ void output_frame_notify(struct wl_listener *listener, void *data) {
 | 
				
			||||||
	clock_gettime(CLOCK_MONOTONIC, &now);
 | 
						clock_gettime(CLOCK_MONOTONIC, &now);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!wlr_output_attach_render(output->wlr_output, NULL)) {
 | 
						if (!wlr_output_attach_render(output->wlr_output, NULL)) {
 | 
				
			||||||
 | 
							wlr_log_errno(WLR_ERROR, "%s", _("Couldn't attach renderer to output"));
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	int width, height;
 | 
						int width, height;
 | 
				
			||||||
| 
						 | 
					@ -119,6 +121,7 @@ void new_output_notify(struct wl_listener *listener, void *data) {
 | 
				
			||||||
			listener, server, new_output
 | 
								listener, server, new_output
 | 
				
			||||||
			);
 | 
								);
 | 
				
			||||||
	struct wlr_output *wlr_output = data;
 | 
						struct wlr_output *wlr_output = data;
 | 
				
			||||||
 | 
						wlr_log(WLR_INFO, "%s: %s", _("New output device detected"), wlr_output->name);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!wl_list_empty(&wlr_output->modes)) {
 | 
						if (!wl_list_empty(&wlr_output->modes)) {
 | 
				
			||||||
		struct wlr_output_mode *mode = wlr_output_preferred_mode(wlr_output);
 | 
							struct wlr_output_mode *mode = wlr_output_preferred_mode(wlr_output);
 | 
				
			||||||
| 
						 | 
					@ -126,6 +129,7 @@ void new_output_notify(struct wl_listener *listener, void *data) {
 | 
				
			||||||
		wlr_output_enable(wlr_output, true);
 | 
							wlr_output_enable(wlr_output, true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (!wlr_output_commit(wlr_output)) {
 | 
							if (!wlr_output_commit(wlr_output)) {
 | 
				
			||||||
 | 
								wlr_log_errno(WLR_ERROR, "%s", _("Couldn't commit pending frame to output"));
 | 
				
			||||||
			return;
 | 
								return;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -128,12 +128,15 @@ static void new_input_notify(struct wl_listener *listener, void *data) {
 | 
				
			||||||
	struct wb_server *server = wl_container_of(listener, server, new_input);
 | 
						struct wb_server *server = wl_container_of(listener, server, new_input);
 | 
				
			||||||
	switch (device->type) {
 | 
						switch (device->type) {
 | 
				
			||||||
		case WLR_INPUT_DEVICE_KEYBOARD:
 | 
							case WLR_INPUT_DEVICE_KEYBOARD:
 | 
				
			||||||
 | 
								wlr_log(WLR_INFO, "%s: %s", _("New keyboard detected"), device->name);
 | 
				
			||||||
			handle_new_keyboard(server, device);
 | 
								handle_new_keyboard(server, device);
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		case WLR_INPUT_DEVICE_POINTER:
 | 
							case WLR_INPUT_DEVICE_POINTER:
 | 
				
			||||||
 | 
								wlr_log(WLR_INFO, "%s: %s", _("New pointer detected"), device->name);
 | 
				
			||||||
			wlr_cursor_attach_input_device(server->cursor->cursor, device);
 | 
								wlr_cursor_attach_input_device(server->cursor->cursor, device);
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		default:
 | 
							default:
 | 
				
			||||||
 | 
								wlr_log(WLR_INFO, "%s: %s", _("Unsupported input device detected"), device->name);
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -46,13 +46,7 @@ bool wb_start_server(struct wb_server* server) {
 | 
				
			||||||
		return false;
 | 
							return false;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	const char*const tmp = _("Running Wayland compositor on Wayland display '%s'");
 | 
						wlr_log(WLR_INFO, "%s: WAYLAND_DISPLAY=%s", _("Running Wayland compositor on Wayland display"), socket);
 | 
				
			||||||
	char *sockmsg = calloc(sizeof(char), strlen(tmp) + strlen(socket) - 2);
 | 
					 | 
				
			||||||
	if (sockmsg) {
 | 
					 | 
				
			||||||
		sprintf(sockmsg, tmp, socket);
 | 
					 | 
				
			||||||
		wlr_log(WLR_INFO, "%s", sockmsg);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	free(sockmsg);
 | 
					 | 
				
			||||||
	setenv("WAYLAND_DISPLAY", socket, true);
 | 
						setenv("WAYLAND_DISPLAY", socket, true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	wlr_gamma_control_manager_v1_create(server->wl_display);
 | 
						wlr_gamma_control_manager_v1_create(server->wl_display);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,8 @@
 | 
				
			||||||
#include "waybox/xdg_shell.h"
 | 
					#include "waybox/xdg_shell.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void focus_view(struct wb_view *view, struct wlr_surface *surface) {
 | 
					void focus_view(struct wb_view *view, struct wlr_surface *surface) {
 | 
				
			||||||
 | 
						wlr_log(WLR_INFO, "%s: %s", _("Keyboard focus is now on surface"),
 | 
				
			||||||
 | 
								wlr_xdg_surface_from_wlr_surface(surface)->toplevel->app_id);
 | 
				
			||||||
	/* Note: this function only deals with keyboard focus. */
 | 
						/* Note: this function only deals with keyboard focus. */
 | 
				
			||||||
	if (view == NULL) {
 | 
						if (view == NULL) {
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
| 
						 | 
					@ -54,11 +56,15 @@ static void xdg_surface_unmap(struct wl_listener *listener, void *data) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* If the current view is mapped, focus it. */
 | 
						/* If the current view is mapped, focus it. */
 | 
				
			||||||
	if (current_view->mapped) {
 | 
						if (current_view->mapped) {
 | 
				
			||||||
 | 
							wlr_log(WLR_INFO, "%s: %s", _("Focusing current view"),
 | 
				
			||||||
 | 
									current_view->xdg_surface->toplevel->app_id);
 | 
				
			||||||
		focus_view(current_view, current_view->xdg_surface->surface);
 | 
							focus_view(current_view, current_view->xdg_surface->surface);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	/* Otherwise, focus the next view, if any. */
 | 
						/* Otherwise, focus the next view, if any. */
 | 
				
			||||||
	else if (next_view->xdg_surface->surface &&
 | 
						else if (next_view->xdg_surface->surface &&
 | 
				
			||||||
			wlr_surface_is_xdg_surface(next_view->xdg_surface->surface)) {
 | 
								wlr_surface_is_xdg_surface(next_view->xdg_surface->surface)) {
 | 
				
			||||||
 | 
							wlr_log(WLR_INFO, "%s: %s", _("Focusing next view"),
 | 
				
			||||||
 | 
									next_view->xdg_surface->toplevel->app_id);
 | 
				
			||||||
		focus_view(next_view, 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