~andreas-pokorny/mir/use-ld-preload-in-test-script

« back to all changes in this revision

Viewing changes to playground/demo-shell/window_manager.cpp

  • Committer: Tarmac
  • Author(s): Daniel van Vugt
  • Date: 2015-01-14 08:52:38 UTC
  • mfrom: (2207.2.4 close-examples)
  • Revision ID: tarmac-20150114085238-kxgzrsze7imgcjr7
Add close/quit message support to some examples, and invoke it from the
demo shell via Alt+F4.
.

Approved by PS Jenkins bot, Alan Griffiths, Robert Carr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
147
147
            focus_controller->focus_next();
148
148
            return true;
149
149
        }
 
150
        else if (event.key.modifiers & mir_key_modifier_alt &&
 
151
                 event.key.scan_code == KEY_F4)
 
152
        {
 
153
            auto const app = focus_controller->focussed_application().lock();
 
154
            if (app)
 
155
            {
 
156
                // Ask the app to close politely. It has the right to refuse.
 
157
                auto const surf = app->default_surface();
 
158
                if (surf)
 
159
                {
 
160
                    surf->request_client_surface_close();
 
161
                    return true;
 
162
                }
 
163
            }
 
164
        }
150
165
        else if ((event.key.modifiers & mir_key_modifier_alt &&
151
166
                  event.key.scan_code == KEY_P) ||
152
167
                 (event.key.scan_code == KEY_POWER))