Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework the miral-shell background to use Wayland #669

Merged
merged 15 commits into from Dec 14, 2018
Merged

Tidy code

  • Loading branch information...
AlanGriffiths committed Dec 14, 2018
commit 92d1a1cab69084e851cbeea79eaa4113e7b92747
@@ -299,16 +299,17 @@ void DecorationProvider::Self::draw_background(BackgroundInfo& ctx) const
wl_buffer_destroy(ctx.buffer);
}

struct wl_shm_pool* shm_pool =
make_shm_pool(this->globals.shm, stride * height, &ctx.content_area);
ctx.buffer =
wl_shm_pool_create_buffer(
shm_pool,
0,
width, height,
width * 4,
WL_SHM_FORMAT_ARGB8888);
wl_shm_pool_destroy(shm_pool);
{
auto const shm_pool = make_scoped(
make_shm_pool(this->globals.shm, stride * height, &ctx.content_area),
&wl_shm_pool_destroy);

ctx.buffer = wl_shm_pool_create_buffer(
shm_pool.get(),
0,
width, height, stride,
WL_SHM_FORMAT_ARGB8888);
}

uint8_t const bottom_colour[] = { 0x20, 0x54, 0xe9 }; // Ubuntu orange
uint8_t const top_colour[] = { 0x33, 0x33, 0x33 }; // Cool grey
@@ -381,11 +381,6 @@ void FloatingWindowManagerPolicy::handle_window_ready(WindowInfo& window_info)
keep_spinner_on_top();
}

void FloatingWindowManagerPolicy::advise_focus_lost(WindowInfo const& info)
{
CanonicalWindowManagerPolicy::advise_focus_lost(info);
}

void FloatingWindowManagerPolicy::advise_focus_gained(WindowInfo const& info)
{
CanonicalWindowManagerPolicy::advise_focus_gained(info);
@@ -404,21 +399,6 @@ void FloatingWindowManagerPolicy::keep_spinner_on_top()
}
}

void FloatingWindowManagerPolicy::advise_state_change(WindowInfo const& window_info, MirWindowState state)
{
CanonicalWindowManagerPolicy::advise_state_change(window_info, state);
}

void FloatingWindowManagerPolicy::advise_resize(WindowInfo const& window_info, Size const& new_size)
{
CanonicalWindowManagerPolicy::advise_resize(window_info, new_size);
}

void FloatingWindowManagerPolicy::advise_delete_window(WindowInfo const& window_info)
{
CanonicalWindowManagerPolicy::advise_delete_window(window_info);
}

bool FloatingWindowManagerPolicy::handle_keyboard_event(MirKeyboardEvent const* event)
{
auto const action = mir_keyboard_event_action(event);
@@ -65,11 +65,7 @@ class FloatingWindowManagerPolicy : public miral::CanonicalWindowManagerPolicy
* @{ */
void advise_new_window(miral::WindowInfo const& window_info) override;
void handle_window_ready(miral::WindowInfo& window_info) override;
void advise_focus_lost(miral::WindowInfo const& info) override;
void advise_focus_gained(miral::WindowInfo const& info) override;
void advise_state_change(miral::WindowInfo const& window_info, MirWindowState state) override;
void advise_resize(miral::WindowInfo const& window_info, Size const& new_size) override;
void advise_delete_window(miral::WindowInfo const& window_info) override;

void handle_modify_window(miral::WindowInfo& window_info, miral::WindowSpecification const& modifications) override;
/** @} */
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.