- for (int i = 0; i < xcb_get_property_value_length(preply); i++) {
- if (atom[i] != atoms[_NET_WM_WINDOW_TYPE_DOCK])
- continue;
- LOG("Window is a dock.\n");
- new->dock = true;
- new->titlebar_position = TITLEBAR_OFF;
- new->force_reconfigure = true;
- new->container = NULL;
- SLIST_INSERT_HEAD(&(c_ws->screen->dock_clients), new, dock_clients);
- }
+ for (int i = 0; i < xcb_get_property_value_length(preply); i++)
+ if (atom[i] == atoms[_NET_WM_WINDOW_TYPE_DOCK]) {
+ LOG("Window is a dock.\n");
+ new->dock = true;
+ new->borderless = true;
+ new->titlebar_position = TITLEBAR_OFF;
+ new->force_reconfigure = true;
+ new->container = NULL;
+ SLIST_INSERT_HEAD(&(c_ws->screen->dock_clients), new, dock_clients);
+ /* If it’s a dock we can’t make it float, so we break */
+ new->floating = FLOATING_AUTO_OFF;
+ break;
+ } else if (atom[i] == atoms[_NET_WM_WINDOW_TYPE_DIALOG] ||
+ atom[i] == atoms[_NET_WM_WINDOW_TYPE_UTILITY] ||
+ atom[i] == atoms[_NET_WM_WINDOW_TYPE_TOOLBAR] ||
+ atom[i] == atoms[_NET_WM_WINDOW_TYPE_SPLASH]) {
+ /* Set the dialog window to automatically floating, will be used below */
+ new->floating = FLOATING_AUTO_ON;
+ LOG("dialog/utility/toolbar/splash window, automatically floating\n");
+ }
+ }
+
+ /* All clients which have a leader should be floating */
+ if (!new->dock && !client_is_floating(new) && new->leader != 0) {
+ LOG("Client has WM_CLIENT_LEADER hint set, setting floating\n");
+ new->floating = FLOATING_AUTO_ON;
+ }
+
+ if (new->workspace->auto_float) {
+ new->floating = FLOATING_AUTO_ON;
+ LOG("workspace is in autofloat mode, setting floating\n");