[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [virt-tools-list] [PATCH virt-viewer 09/12] kiosk: prevent app to quit or window to hide



On Thu, Aug 15, 2013 at 4:45 PM, Daniel P. Berrange <berrange redhat com> wrote:
> On Mon, Jul 15, 2013 at 09:36:16PM +0200, Marc-André Lureau wrote:
>> ---
>>  src/virt-viewer-app.c    | 5 +++++
>>  src/virt-viewer-window.c | 5 +++++
>>  2 files changed, 10 insertions(+)
>>
>> diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
>> index ffcf451..86ebdad 100644
>> --- a/src/virt-viewer-app.c
>> +++ b/src/virt-viewer-app.c
>> @@ -247,6 +247,11 @@ virt_viewer_app_quit(VirtViewerApp *self)
>>      g_return_if_fail(VIRT_VIEWER_IS_APP(self));
>>      VirtViewerAppPrivate *priv = self->priv;
>>
>> +    if (self->priv->kiosk) {
>> +        g_warning("The app is in kiosk mode and can't quit");
>> +        return;
>> +    }
>> +
>>      virt_viewer_app_save_config(self);
>>
>>      if (priv->session) {
>> diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
>> index f483027..5590443 100644
>> --- a/src/virt-viewer-window.c
>> +++ b/src/virt-viewer-window.c
>> @@ -1194,6 +1194,11 @@ virt_viewer_window_show(VirtViewerWindow *self)
>>  void
>>  virt_viewer_window_hide(VirtViewerWindow *self)
>>  {
>> +    if (self->priv->kiosk) {
>> +        g_warning("Can't hide windows in kiosk mode");
>> +        return;
>> +    }
>> +
>>      gtk_widget_hide(self->priv->window);
>>
>>      if (self->priv->display) {
>
> Rather than logging warnings, can't we just not call these methods
> when in kiosk mode ?

These condition shouldn't happen, this is here for debugging purposes
(ie file a bug if it happens).


-- 
Marc-André Lureau


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]