Commit 11d5be84 authored by Guido Gunther's avatar Guido Gunther
Browse files

polkit-auth-prompt: Use PhoshSystemModal


Signed-off-by: Guido Gunther's avatarGuido Günther <guido.gunther@puri.sm>
parent 03d551e4
......@@ -131,9 +131,6 @@ on_prompt_done (PhoshPolkitAuthPrompt *prompt, gboolean cancelled, AuthRequest *
static void
auth_request_initiate (AuthRequest *request)
{
PhoshWayland *wl = phosh_wayland_get_default ();
PhoshShell *shell = phosh_shell_get_default ();
PhoshMonitor *primary_monitor;
g_auto(GStrv) user_names;
GPtrArray *p;
GList *l;
......@@ -167,7 +164,6 @@ auth_request_initiate (AuthRequest *request)
user_names = (char **) g_ptr_array_free (p, FALSE);
g_debug("New prompt for %s", request->message);
primary_monitor = phosh_shell_get_primary_monitor (shell);
/* We must not issue a new prompt when there's one alread */
g_return_if_fail (!request->agent->current_prompt);
request->agent->current_prompt = PHOSH_POLKIT_AUTH_PROMPT (
......@@ -176,9 +172,7 @@ auth_request_initiate (AuthRequest *request)
request->message,
request->icon_name,
request->cookie,
user_names,
phosh_wayland_get_zwlr_layer_shell_v1(wl),
primary_monitor->wl_output));
user_names));
g_signal_connect (request->agent->current_prompt,
"done",
......
......@@ -51,7 +51,7 @@ static guint signals[N_SIGNALS] = { 0 };
struct _PhoshPolkitAuthPrompt
{
PhoshLayerSurface parent;
PhoshSystemModal parent;
GtkWidget *lbl_message;
GtkWidget *lbl_user_name;
......@@ -75,7 +75,7 @@ struct _PhoshPolkitAuthPrompt
gboolean done_emitted;
};
G_DEFINE_TYPE(PhoshPolkitAuthPrompt, phosh_polkit_auth_prompt, PHOSH_TYPE_LAYER_SURFACE);
G_DEFINE_TYPE(PhoshPolkitAuthPrompt, phosh_polkit_auth_prompt, PHOSH_TYPE_SYSTEM_MODAL);
static void phosh_polkit_auth_prompt_initiate (PhoshPolkitAuthPrompt *self);
......@@ -561,9 +561,7 @@ phosh_polkit_auth_prompt_new (const char *action_id,
const char *message,
const char *icon_name,
const char *cookie,
GStrv user_names,
gpointer layer_shell,
gpointer wl_output)
GStrv user_names)
{
return g_object_new (PHOSH_TYPE_POLKIT_AUTH_PROMPT,
/* polkit prompt */
......@@ -572,16 +570,5 @@ phosh_polkit_auth_prompt_new (const char *action_id,
"message", message,
"icon-name", icon_name,
"user-names", user_names,
/* layer shell */
"layer-shell", layer_shell,
"wl-output", wl_output,
"anchor", ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP |
ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM |
ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT |
ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT,
"layer", ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY,
"kbd-interactivity", TRUE,
"exclusive-zone", -1,
"namespace", "phosh prompter",
NULL);
}
......@@ -7,18 +7,16 @@
#pragma once
#include <gtk/gtk.h>
#include "layersurface.h"
#include "system-modal.h"
#define PHOSH_TYPE_POLKIT_AUTH_PROMPT (phosh_polkit_auth_prompt_get_type())
G_DECLARE_FINAL_TYPE (PhoshPolkitAuthPrompt, phosh_polkit_auth_prompt, PHOSH, POLKIT_AUTH_PROMPT, PhoshLayerSurface);
G_DECLARE_FINAL_TYPE (PhoshPolkitAuthPrompt, phosh_polkit_auth_prompt, PHOSH, POLKIT_AUTH_PROMPT, PhoshSystemModal);
GtkWidget *phosh_polkit_auth_prompt_new (const char *action_id,
const char *message,
const char *icon_name,
const char *cookie,
GStrv user_names,
gpointer layer_shell,
gpointer wl_output);
GStrv user_names);
......@@ -2,7 +2,7 @@
<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<template class="PhoshPolkitAuthPrompt" parent="PhoshLayerSurface">
<template class="PhoshPolkitAuthPrompt" parent="PhoshSystemModal">
<property name="can_focus">False</property>
<child>
<placeholder/>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment