Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions plugins/grid/grid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "wayfire/plugins/grid.hpp"
#include "wayfire/plugins/crossfade.hpp"
#include <wayfire/window-manager.hpp>
#include <wayfire/util/log.hpp>

#include <wayfire/plugins/wobbly/wobbly-signal.hpp>
#include <wayfire/view-transform.hpp>
Expand Down Expand Up @@ -134,6 +135,7 @@ class wayfire_grid : public wf::plugin_interface_t, public wf::per_output_tracke
/* Tile the view as the preview shows, not what the signal suggests */
if ((ev->operation == wf::grid::MOVE_OP_DROP) && slot.slot_id)
{
log_slot(ev->view, slot.slot_id, "snap to");
ev->view->toplevel()->pending().tiled_edges = wf::grid::get_tiled_edges_for_slot(slot.slot_id);
auto desired_size = wf::grid::get_slot_dimensions(ev->view->get_output(), slot.slot_id);
ev->view->get_data_safe<wf_grid_slot_data>()->slot = slot.slot_id;
Expand Down Expand Up @@ -209,13 +211,30 @@ class wayfire_grid : public wf::plugin_interface_t, public wf::per_output_tracke
return is_floating && (view->get_output() != nullptr) && view->toplevel()->pending().mapped;
}

void log_slot(wayfire_toplevel_view view, int slot_id, const char *action)
{
static constexpr const char *slot_names[] = {
"none", "bottom-left", "bottom", "bottom-right",
"left", "center", "right",
"top-left", "top", "top-right"
};

const char *name = (slot_id >= 0 && slot_id < 10) ?
slot_names[slot_id] : "unknown";

LOGD("grid: ", action, " slot ", name,
" on ", view->get_output()->to_string(),
" [app-id: ", view->get_app_id(), "]");
}

void handle_slot(wayfire_toplevel_view view, int slot, wf::pointf_t delta = {0, 0})
{
if (!can_adjust_view(view))
{
return;
}

log_slot(view, slot, "apply");
view->get_data_safe<wf_grid_slot_data>()->slot = slot;
auto slot_geometry = wf::grid::get_slot_dimensions(view->get_output(), slot) + delta;
ensure_grid_view(view)->adjust_target_geometry(
Expand Down Expand Up @@ -282,6 +301,15 @@ class wayfire_grid : public wf::plugin_interface_t, public wf::per_output_tracke

data->carried_out = true;
uint32_t slot = wf::grid::get_slot_from_tiled_edges(data->edges);
if (data->edges == 0)
{
LOGD("grid: restore on ", data->view->get_output()->to_string(),
" [app-id: ", data->view->get_app_id(), "]");
} else
{
log_slot(data->view, slot, "tile to");
}

if (slot > 0)
{
data->desired_size = wf::grid::get_slot_dimensions(data->view->get_output(), slot);
Expand Down
3 changes: 3 additions & 0 deletions plugins/single_plugins/autostart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class wayfire_autostart : public wf::plugin_interface_t
continue;
}

LOGI("Autostart: ", name, " = ", command);
wf::get_core().run(command);
if (command.find("wf-panel") != std::string::npos)
{
Expand All @@ -43,11 +44,13 @@ class wayfire_autostart : public wf::plugin_interface_t

if (autostart_wf_shell && !panel_manually_started)
{
LOGI("Autostart: launching wf-panel");
wf::get_core().run("wf-panel");
}

if (autostart_wf_shell && !background_manually_started)
{
LOGI("Autostart: launching wf-background");
wf::get_core().run("wf-background");
}
}
Expand Down
15 changes: 15 additions & 0 deletions plugins/single_plugins/move.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include <wayfire/plugins/vswitch.hpp>
#include <wayfire/workarea.hpp>
#include <wayfire/window-manager.hpp>
#include <wayfire/util/log.hpp>
#include <string>

#include <linux/input.h>
#include <wayfire/signal-definitions.hpp>
Expand Down Expand Up @@ -165,6 +167,7 @@ class wayfire_move : public wf::per_output_plugin_instance_t,
};

std::unique_ptr<wf::input_grab_t> input_grab;
std::string active_app_id;
wf::plugin_activation_data_t grab_interface = {
.name = "move",
.capabilities = wf::CAPABILITY_GRAB_INPUT | wf::CAPABILITY_MANAGE_DESKTOP,
Expand Down Expand Up @@ -306,6 +309,12 @@ class wayfire_move : public wf::per_output_plugin_instance_t,
return false;
}

active_app_id = view->get_app_id();
if (!active_app_id.empty())
{
LOGD("move: activate on ", output->to_string(), " [app-id: ", active_app_id, "]");
}

this->input_grab->grab_input(wf::scene::layer::OVERLAY);
update_slot(wf::grid::MOVE_OP_CLEAR_PREVIEW);
return true;
Expand Down Expand Up @@ -367,6 +376,12 @@ class wayfire_move : public wf::per_output_plugin_instance_t,
{
input_grab->ungrab_input();
output->deactivate_plugin(&grab_interface);

if (!active_app_id.empty())
{
LOGD("move: deactivate on ", output->to_string(), " [app-id: ", active_app_id, "]");
active_app_id.clear();
}
}

void input_pressed(uint32_t state)
Expand Down
15 changes: 15 additions & 0 deletions plugins/single_plugins/resize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include <wayfire/plugins/wobbly/wobbly-signal.hpp>
#include <wayfire/nonstd/wlroots-full.hpp>
#include <wlr/util/edges.h>
#include <wayfire/util/log.hpp>
#include <string>

class wayfire_resize : public wf::per_output_plugin_instance_t, public wf::pointer_interaction_t,
public wf::touch_interaction_t
Expand Down Expand Up @@ -69,6 +71,7 @@ class wayfire_resize : public wf::per_output_plugin_instance_t, public wf::point
wf::option_wrapper_t<wf::buttonbinding_t> button_preserve_aspect{
"resize/activate_preserve_aspect"};
std::unique_ptr<wf::input_grab_t> input_grab;
std::string active_app_id;
wf::plugin_activation_data_t grab_interface = {
.name = "resize",
.capabilities = wf::CAPABILITY_GRAB_INPUT | wf::CAPABILITY_MANAGE_DESKTOP,
Expand Down Expand Up @@ -251,6 +254,12 @@ class wayfire_resize : public wf::per_output_plugin_instance_t, public wf::point
return false;
}

active_app_id = view->get_app_id();
if (!active_app_id.empty())
{
LOGD("resize: activate on ", output->to_string(), " [app-id: ", active_app_id, "]");
}

input_grab->set_wants_raw_input(true);
input_grab->grab_input(wf::scene::layer::OVERLAY);

Expand Down Expand Up @@ -293,6 +302,12 @@ class wayfire_resize : public wf::per_output_plugin_instance_t, public wf::point
input_grab->ungrab_input();
output->deactivate_plugin(&grab_interface);

if (!active_app_id.empty())
{
LOGD("resize: deactivate on ", output->to_string(), " [app-id: ", active_app_id, "]");
active_app_id.clear();
}

if (view)
{
end_wobbly(view);
Expand Down
4 changes: 3 additions & 1 deletion plugins/window-rules/window-rules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ void wayfire_window_rules_t::apply(const std::string & signal, wayfire_view view
auto error = rule->apply(signal, _access_interface, _action_interface);
if (error)
{
LOGE("Window-rules: Error while executing rule on ", signal, " signal.");
const auto app_id = view->get_app_id();
LOGE("Window-rules: Error while executing rule on ", signal, " signal.",
app_id.empty() ? "" : " [app-id: " + app_id + "]");
}
}

Expand Down
9 changes: 7 additions & 2 deletions src/output/promotion-manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class promotion_manager_t
wayfire_toplevel_view candidate = find_top_visible_view(output->wset()->get_node());
if (candidate && candidate->toplevel()->current().fullscreen)
{
promoted_app_id = candidate->get_app_id();
start_promotion();
} else
{
Expand All @@ -88,6 +89,7 @@ class promotion_manager_t
}

bool promotion_active = false;
std::string promoted_app_id;

// When a fullscreen view is on top of the stack, it should be displayed above
// nodes in the TOP layer. To achieve this effect, we hide the TOP layer.
Expand All @@ -104,7 +106,8 @@ class promotion_manager_t
wf::fullscreen_layer_focused_signal ev;
ev.has_promoted = true;
output->emit(&ev);
LOGD("autohide panels");
LOGD("autohide panels",
promoted_app_id.empty() ? "" : " [app-id: " + promoted_app_id + "]");
}

void stop_promotion()
Expand All @@ -120,7 +123,9 @@ class promotion_manager_t
wf::fullscreen_layer_focused_signal ev;
ev.has_promoted = false;
output->emit(&ev);
LOGD("restore panels");
LOGD("restore panels",
promoted_app_id.empty() ? "" : " [app-id: " + promoted_app_id + "]");
promoted_app_id.clear();
}
};
}
5 changes: 4 additions & 1 deletion src/view/xdg-shell/xdg-toplevel-view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
wf::xdg_toplevel_view_base_t::xdg_toplevel_view_base_t(wlr_xdg_toplevel *toplevel, bool autocommit)
{
this->xdg_toplevel = toplevel;
LOGI("new xdg_shell_stable surface: ", xdg_toplevel->title, " app-id: ", xdg_toplevel->app_id);

this->main_surface = std::make_shared<scene::wlr_surface_node_t>(toplevel->base->surface, autocommit);

Expand Down Expand Up @@ -530,6 +529,10 @@ void wf::fini_xdg_decoration_handlers()

void wf::xdg_toplevel_view_t::start_map_tx()
{
const auto app_id = get_app_id();
LOGI("map xdg_shell_stable surface: ", get_title(),
app_id.empty() ? "" : " [app-id: " + app_id + "]");

LOGC(VIEWS, "Start mapping ", self());
wf::geometry_t box = wf::from_integer_box(xdg_toplevel->base->geometry);
auto margins = wtoplevel->pending().margins;
Expand Down
Loading