Skip to content

Commit

Permalink
Revert "DEBUG logging"
Browse files Browse the repository at this point in the history
This reverts commit a3880b1
  • Loading branch information
AlanGriffiths committed Nov 14, 2024
1 parent 6b1855e commit 7ff8df6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 41 deletions.
44 changes: 8 additions & 36 deletions examples/mir-x11-kiosk/x11_kiosk_window_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
#include <miral/window_info.h>
#include <miral/window_manager_tools.h>

#define MIR_LOG_COMPONENT "X11Kiosk"
#include <mir/log.h>

#include <linux/input.h>

namespace ms = mir::scene;
Expand Down Expand Up @@ -98,12 +95,15 @@ void X11KioskWindowManagerPolicy::handle_modify_window(WindowInfo& window_info,
if ((window_info.type() == mir_window_type_normal || window_info.type() == mir_window_type_freestyle) &&
!window_info.parent())
{
if (modifications.state().is_set())
if (window_info.state() == mir_window_state_fullscreen && modifications.state().is_set())
{
mir::log_debug("** arg ** Mod toplevel window %p, Current state is %d: Client setting state to %d",
(void*)window_info.window().operator std::shared_ptr<mir::scene::Surface>().get(),
(int)window_info.state(),
(int)modifications.state().value());
// If the window is already fullscreen, then first restore it
// as otherwise the client may not repaint
WindowSpecification mods;
mods.state() = mir_window_state_restored;

tools.place_and_size_for_state(mods, window_info);
tools.modify_window(window_info, mods);
}

if (window_info.is_visible() || !modifications.state().is_set() || modifications.state().value() != mir_window_state_restored)
Expand Down Expand Up @@ -135,30 +135,6 @@ void X11KioskWindowManagerPolicy::handle_request_resize(WindowInfo& /*window_inf
{
}

void X11KioskWindowManagerPolicy::advise_new_window(const miral::WindowInfo& window_info)
{
if ((window_info.type() == mir_window_type_normal || window_info.type() == mir_window_type_freestyle) &&
!window_info.parent())
{
mir::log_debug("** arg ** New toplevel window %p, Current state is %d",
(void*)window_info.window().operator std::shared_ptr<mir::scene::Surface>().get(),
(int)window_info.state());
}
CanonicalWindowManagerPolicy::advise_new_window(window_info);
}

void X11KioskWindowManagerPolicy::advise_delete_window(const miral::WindowInfo& window_info)
{
if ((window_info.type() == mir_window_type_normal || window_info.type() == mir_window_type_freestyle) &&
!window_info.parent())
{
mir::log_debug("** arg ** Del toplevel window %p, Current state is %d",
(void*)window_info.window().operator std::shared_ptr<mir::scene::Surface>().get(),
(int)window_info.state());
}
CanonicalWindowManagerPolicy::advise_delete_window(window_info);
}

Rectangle
X11KioskWindowManagerPolicy::confirm_placement_on_display(WindowInfo const& /*window_info*/, MirWindowState /*new_state*/,
Rectangle const& new_placement)
Expand All @@ -171,10 +147,6 @@ void X11KioskWindowManagerPolicy::handle_window_ready(miral::WindowInfo& window_
if ((window_info.type() == mir_window_type_normal || window_info.type() == mir_window_type_freestyle) &&
!window_info.parent())
{
mir::log_debug("** arg ** Ready toplevel window %p, Current state is %d",
(void*)window_info.window().operator std::shared_ptr<mir::scene::Surface>().get(),
(int)window_info.state());

// We have one X11 application (vmware-view) that doesn't submit any buffers unless it
// can first "restore" its window. We've got a buffer now, so we can fullscreen it
if (window_info.state() == mir_window_state_restored)
Expand Down
9 changes: 4 additions & 5 deletions examples/mir-x11-kiosk/x11_kiosk_window_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,12 @@ class X11KioskWindowManagerPolicy : public miral::CanonicalWindowManagerPolicy
void handle_modify_window(miral::WindowInfo& window_info, miral::WindowSpecification const& modifications) override;

void handle_request_move(miral::WindowInfo& window_info, MirInputEvent const* input_event) override;
void handle_window_ready(miral::WindowInfo& window_info) override;
void handle_request_resize(miral::WindowInfo& window_info, MirInputEvent const* input_event,
MirResizeEdge edge) override;
void advise_new_window(const miral::WindowInfo& window_info) override;
void advise_delete_window(const miral::WindowInfo& window_info) override;
MirResizeEdge edge) override;

auto confirm_placement_on_display(const miral::WindowInfo& window_info, MirWindowState new_state,
Rectangle const& new_placement) -> Rectangle override;
void handle_window_ready(miral::WindowInfo& window_info) override;
Rectangle const& new_placement) -> Rectangle override;
};

#endif /* MIRAL_X11_KIOSK_WINDOW_MANAGER_H */

0 comments on commit 7ff8df6

Please sign in to comment.