Update default configuration to work everywhere

287190b64709da8bb651009b1ceed4addb8a4f0c
Alexis Sellier committed ago 1 parent 60828505
config.def.h +9 -13
37 37
    0.0f, 0.0f, 0.0f, 1.0f
38 38
};
39 39
40 40
/* Report errors only. Use WLR_DEBUG for detailed wlroots diagnostics. */
41 41
static int log_level = WLR_ERROR;
42 +
/* Apply an atomic layout after this many milliseconds if a client is unresponsive. */
43 +
static const int transaction_timeout_ms = 200;
42 44
43 45
/* Window rules are applied in order; later matches override earlier ones.
44 46
 * Use "*" as the application ID to match every window. Workspace and monitor
45 47
 * numbers start at zero, and -1 keeps the window's default placement. */
46 48
static const rule_t rules[] = {
47 -
    /* application ID         title    workspace  floating  monitor  borderless */
48 -
    { "org.telegram.desktop", nullptr,  -1, true,        -1,        true },
49 49
    {},
50 50
};
51 51
52 52
/* Layer rules match panels, launchers, and other desktop surfaces by namespace. */
53 53
static const layer_rule_t layerrules[] = {
71 71
 * other negative positions can break XWayland applications. */
72 72
static const monitor_rule_t monrules[] = {
73 73
    /* name        scale  rotation/reflection          x    y
74 74
     * Example for a high-density laptop display:
75 75
     { "eDP-1",    2,    WL_OUTPUT_TRANSFORM_NORMAL,   -1,  -1 }, */
76 -
    { nullptr, 1.5, WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
76 +
    { nullptr, 1.0, WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
77 77
    /* Keep at least one fallback rule. */
78 78
};
79 79
80 80
/* XKB keyboard layout shared by physical keyboards. */
81 81
static const struct xkb_rule_names xkb_rules = {
82 82
    /* XKB layout name. */
83 83
    .layout  = "us",
84 84
    /* Layout variant; altgr-intl provides international characters via AltGr. */
85 -
    .variant = "altgr-intl",
85 +
    .variant = nullptr,
86 86
    /* Comma-separated XKB options, or nullptr for none. */
87 87
    .options = nullptr,
88 88
};
89 89
90 90
/* Repeat a held key this many times per second. */
100 100
/* Keep a tapped item grabbed while the finger moves. */
101 101
static const bool tap_and_drag            = true;
102 102
/* Keep dragging after the finger is briefly lifted and placed down again. */
103 103
static const bool drag_lock               = true;
104 104
/* Reverse the touchpad's usual scrolling direction when enabled. */
105 -
static const bool natural_scrolling       = false;
105 +
static const bool natural_scrolling       = true;
106 106
/* Ignore touchpad input while typing. */
107 107
static const bool disable_while_typing    = true;
108 108
/* Swap the primary and secondary pointer buttons when enabled. */
109 109
static const bool left_handed             = false;
110 110
/* Press the left and right buttons together to produce a middle click. */
111 -
static const bool middle_button_emulation = false;
111 +
static const bool middle_button_emulation = true;
112 112
113 113
/* Scroll with two fingers. Other choices are NO_SCROLL, EDGE, and
114 114
 * ON_BUTTON_DOWN. */
115 115
static const enum libinput_config_scroll_method scroll_method =
116 116
    LIBINPUT_CONFIG_SCROLL_2FG;
117 117
118 -
/* Divide the bottom of a clickpad into physical button areas. Other choices
119 -
 * are NONE and CLICKFINGER. */
118 +
/* Select the click button from the left or right area of the clickpad. */
120 119
static const enum libinput_config_click_method click_method =
121 120
    LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS;
122 121
123 122
/* Keep pointer events enabled. They can instead be disabled always or only
124 123
 * while an external mouse is connected. */
151 150
static const char *volumemutecmd[] = {
152 151
    "wpctl", "set-mute", "@DEFAULT_AUDIO_SINK@", "toggle", nullptr
153 152
};
154 153
/* Adjust the display and keyboard backlight brightness. */
155 154
static const char *brightnessupcmd[] = {
156 -
    "brightnessctl", "set", "5%+", nullptr
155 +
    "brightnessctl", "set", "10%+", nullptr
157 156
};
158 157
static const char *brightnessdowncmd[] = {
159 -
    "brightnessctl", "set", "5%-", nullptr
158 +
    "brightnessctl", "set", "10%-", nullptr
160 159
};
161 160
static const char *keyboardbrightnessupcmd[] = {
162 161
    "brightnessctl", "--device", "*::kbd_backlight", "set", "5%+", nullptr
163 162
};
164 163
static const char *keyboardbrightnessdowncmd[] = {
172 171
/* Run these commands once at startup. A nullptr separates commands, and a
173 172
 * second nullptr ends the list. Environment variables are expanded without
174 173
 * shell word splitting. */
175 174
static const char *const autostart[] = {
176 175
    "foot",                               "--login-shell",                                           nullptr,
177 -
    "swaybg",                             "-m", "tile", "-i", "$HOME/images/wallpaper.png",          nullptr,
178 -
    "sh",                                 "-c", "wl-paste --type text --watch cliphist store",       nullptr,
179 -
    "sh",                                 "-c", "wl-paste --type image --watch cliphist store",      nullptr,
180 176
    nullptr /* End the command list. */
181 177
};
182 178
183 179
static const key_t keys[] = {
184 180
    /* Each row maps a modifier and key to an action and its optional argument. */
test/unit.c +0 -16
429 429
    client_translate_monitor(&client, &newmon, &oldmon);
430 430
    assert(client.prev.x == 0 && client.prev.y == 0);
431 431
    assert_box(*(struct swm_box *)&client.maxstack_prev, 100, 50, 640, 480);
432 432
}
433 433
434 -
/* Verify matching rules update client state and workspace assignment. */
435 -
static void test_rule_application(void) {
436 -
    client_t                client;
437 -
    struct wlr_xdg_surface  surface;
438 -
    struct wlr_xdg_toplevel toplevel;
439 -
440 -
    init_xdg_client(&client, &surface, &toplevel, "org.telegram.desktop", "Telegram");
441 -
    wl_list_init(&mons);
442 -
    selmon = nullptr;
443 -
    apply_rules(&client, nullptr);
444 -
    assert(client.is_floating == 1);
445 -
    assert(client.is_borderless == 1);
446 -
    assert(client.mon == nullptr);
447 -
}
448 -
449 434
/* Verify focus queries across mapped, hidden, and unmanaged clients. */
450 435
static void test_focus_queries(void) {
451 436
    client_t                first, second, hidden;
452 437
    struct wlr_xdg_surface  surfaces[3];
453 438
    struct wlr_xdg_toplevel toplevels[3];
1186 1171
        { "layouts", test_layouts },
1187 1172
        { "utilities", test_utilities },
1188 1173
        { "pools", test_pools },
1189 1174
        { "workspaces", test_workspace_queries },
1190 1175
        { "paths-and-borders", test_paths_and_border_policy },
1191 -
        { "rules", test_rule_application },
1192 1176
        { "focus", test_focus_queries },
1193 1177
        { "workspace-scale", test_workspace_scale },
1194 1178
        { "output-scale-change", test_output_scale_change },
1195 1179
        { "layer-popup-parent", test_layer_popup_parent },
1196 1180
        { "window-state", test_window_state_storage },