]> git.mdlowis.com Git - proto/labwc.git/commitdiff
Minor style fixes
authorJohan Malm <jgm323@gmail.com>
Fri, 29 May 2020 21:26:16 +0000 (22:26 +0100)
committerJohan Malm <jgm323@gmail.com>
Fri, 29 May 2020 21:26:16 +0000 (22:26 +0100)
include/labwc.h
src/cursor.c
src/keyboard.c
src/output.c
src/xdg.c

index cb806b0cf62777e047223aaef7b70d93fdea7f3d..872feec230f7eeae35168c9ee078e57a3ece6666 100644 (file)
@@ -37,9 +37,9 @@
 #define LAB_DISABLE_CSD (0)
 
 enum cursor_mode {
-       TINYWL_CURSOR_PASSTHROUGH,
-       TINYWL_CURSOR_MOVE,
-       TINYWL_CURSOR_RESIZE,
+       LAB_CURSOR_PASSTHROUGH,
+       LAB_CURSOR_MOVE,
+       LAB_CURSOR_RESIZE,
 };
 
 struct server {
index e26b535777b68e98f846f601c5ddf5222c4455ae..78b466c9103880b2c0adbcffc2cc78dff058e713 100644 (file)
@@ -59,10 +59,10 @@ static void process_cursor_resize(struct server *server, uint32_t time)
 static void process_cursor_motion(struct server *server, uint32_t time)
 {
        /* If the mode is non-passthrough, delegate to those functions. */
-       if (server->cursor_mode == TINYWL_CURSOR_MOVE) {
+       if (server->cursor_mode == LAB_CURSOR_MOVE) {
                process_cursor_move(server, time);
                return;
-       } else if (server->cursor_mode == TINYWL_CURSOR_RESIZE) {
+       } else if (server->cursor_mode == LAB_CURSOR_RESIZE) {
                process_cursor_resize(server, time);
                return;
        }
@@ -81,12 +81,12 @@ static void process_cursor_motion(struct server *server, uint32_t time)
                 * a default. This is what makes the cursor image appear when
                 * you move it around the screen, not over any views. */
                wlr_xcursor_manager_set_cursor_image(
-                       server->cursor_mgr, "left_ptr", server->cursor);
+                       server->cursor_mgr, XCURSOR_DEFAULT, server->cursor);
        }
        switch (view_area) {
        case LAB_DECO_PART_TOP:
                wlr_xcursor_manager_set_cursor_image(
-                       server->cursor_mgr, "left_ptr", server->cursor);
+                       server->cursor_mgr, XCURSOR_DEFAULT, server->cursor);
                break;
        case LAB_DECO_PART_LEFT:
                wlr_xcursor_manager_set_cursor_image(
@@ -181,16 +181,16 @@ void cursor_button(struct wl_listener *listener, void *data)
                                    &view_area);
        if (event->state == WLR_BUTTON_RELEASED) {
                /* Exit interactive move/resize mode. */
-               server->cursor_mode = TINYWL_CURSOR_PASSTHROUGH;
+               server->cursor_mode = LAB_CURSOR_PASSTHROUGH;
        } else {
                /* Focus that client if the button was _pressed_ */
                view_focus(view);
                switch (view_area) {
                case LAB_DECO_PART_TOP:
-                       interactive_begin(view, TINYWL_CURSOR_MOVE, 0);
+                       interactive_begin(view, LAB_CURSOR_MOVE, 0);
                        break;
                case LAB_DECO_PART_LEFT:
-                       interactive_begin(view, TINYWL_CURSOR_RESIZE,
+                       interactive_begin(view, LAB_CURSOR_RESIZE,
                                          WLR_EDGE_LEFT);
                        break;
                }
index e8fb4bd98ee741280b6cfa1d9885f381e1e163a2..364b56c347b57d1913be2ecdfada644a16bd79bc 100644 (file)
@@ -44,8 +44,8 @@ static bool handle_keybinding(struct server *server, xkb_keysym_t sym)
                }
                break;
        case XKB_KEY_F6:
-               interactive_begin(view_front_toplevel(server),
-                                 TINYWL_CURSOR_MOVE, 0);
+               interactive_begin(view_front_toplevel(server), LAB_CURSOR_MOVE,
+                                 0);
                break;
        case XKB_KEY_F12:
                dbg_show_views(server);
index 633aa4996075a0ad048cb9cc692e6601b98dd6ff..d89185ac527e12eb29147446145dce965f07adbe 100644 (file)
@@ -78,8 +78,7 @@ static void render_surface(struct wlr_surface *surface, int sx, int sy,
        ox += view->x + sx;
        oy += view->y + sy;
 
-       /* We also have to apply the scale factor for HiDPI outputs. This is
-        * only part of the puzzle, TinyWL does not fully support HiDPI. */
+       /* TODO: Support HiDPI */
        struct wlr_box box = {
                .x = ox * output->scale,
                .y = oy * output->scale,
@@ -105,8 +104,10 @@ static void render_surface(struct wlr_surface *surface, int sx, int sy,
        wlr_matrix_project_box(matrix, &box, transform, 0,
                               output->transform_matrix);
 
-       /* This takes our matrix, the texture, and an alpha, and performs the
-        * actual rendering on the GPU. */
+       /*
+        * This takes our matrix, the texture, and an alpha, and performs the
+        * actual rendering on the GPU.
+        */
        wlr_render_texture_with_matrix(rdata->renderer, texture, matrix, 1);
 
        /* This lets the client know that we've displayed that frame and it can
index 267a8e16132c1442ddee7cef679cdd604f69ccf7..6b2a153a9708d4a3b4580f26193da3f536322995 100644 (file)
--- a/src/xdg.c
+++ b/src/xdg.c
@@ -81,7 +81,7 @@ void xdg_toplevel_request_move(struct wl_listener *listener, void *data)
         * client, to prevent the client from requesting this whenever they
         * want. */
        struct view *view = wl_container_of(listener, view, request_move);
-       interactive_begin(view, TINYWL_CURSOR_MOVE, 0);
+       interactive_begin(view, LAB_CURSOR_MOVE, 0);
 }
 
 void xdg_toplevel_request_resize(struct wl_listener *listener, void *data)
@@ -95,7 +95,7 @@ void xdg_toplevel_request_resize(struct wl_listener *listener, void *data)
         * want. */
        struct wlr_xdg_toplevel_resize_event *event = data;
        struct view *view = wl_container_of(listener, view, request_resize);
-       interactive_begin(view, TINYWL_CURSOR_RESIZE, event->edges);
+       interactive_begin(view, LAB_CURSOR_RESIZE, event->edges);
 }
 
 void xdg_surface_new(struct wl_listener *listener, void *data)