uterm: vt: remove duplicate kmscon_vt_action
This enum is not needed as the uterm-vt code already has enums for vt-actions. Replace it with UTERM_VT_ACTIVATE/DEACTIVATE. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
parent
1101a6b5c3
commit
edae24f501
@ -50,18 +50,13 @@
|
|||||||
|
|
||||||
struct kmscon_vt;
|
struct kmscon_vt;
|
||||||
|
|
||||||
enum kmscon_vt_action {
|
|
||||||
KMSCON_VT_ENTER,
|
|
||||||
KMSCON_VT_LEAVE,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum kmscon_vt_id {
|
enum kmscon_vt_id {
|
||||||
KMSCON_VT_CUR = 0,
|
KMSCON_VT_CUR = 0,
|
||||||
KMSCON_VT_NEW = -1,
|
KMSCON_VT_NEW = -1,
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef bool (*kmscon_vt_cb) (struct kmscon_vt *vt,
|
typedef bool (*kmscon_vt_cb) (struct kmscon_vt *vt,
|
||||||
enum kmscon_vt_action action,
|
unsigned int action,
|
||||||
void *data);
|
void *data);
|
||||||
|
|
||||||
void kmscon_vt_close(struct kmscon_vt *vt);
|
void kmscon_vt_close(struct kmscon_vt *vt);
|
||||||
@ -144,7 +139,7 @@ static void vt_enter(struct ev_eloop *eloop, struct signalfd_siginfo *info,
|
|||||||
log_warn("cannot set graphics mode on vt %p", vt);
|
log_warn("cannot set graphics mode on vt %p", vt);
|
||||||
|
|
||||||
if (vt->cb)
|
if (vt->cb)
|
||||||
vt->cb(vt, KMSCON_VT_ENTER, vt->data);
|
vt->cb(vt, UTERM_VT_ACTIVATE, vt->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vt_leave(struct ev_eloop *eloop, struct signalfd_siginfo *info,
|
static void vt_leave(struct ev_eloop *eloop, struct signalfd_siginfo *info,
|
||||||
@ -161,7 +156,7 @@ static void vt_leave(struct ev_eloop *eloop, struct signalfd_siginfo *info,
|
|||||||
if (ret || vts.v_active != vt->num)
|
if (ret || vts.v_active != vt->num)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (vt->cb && !vt->cb(vt, KMSCON_VT_LEAVE, vt->data)) {
|
if (vt->cb && !vt->cb(vt, UTERM_VT_DEACTIVATE, vt->data)) {
|
||||||
log_debug("leaving VT %d %p denied", vt->num, vt);
|
log_debug("leaving VT %d %p denied", vt->num, vt);
|
||||||
ioctl(vt->fd, VT_RELDISP, 0);
|
ioctl(vt->fd, VT_RELDISP, 0);
|
||||||
} else {
|
} else {
|
||||||
@ -487,25 +482,9 @@ static int vt_call(struct uterm_vt *vt, unsigned int event)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool vt_event(struct kmscon_vt *ovt, enum kmscon_vt_action action,
|
static bool vt_event(struct kmscon_vt *ovt, unsigned int action, void *data)
|
||||||
void *data)
|
|
||||||
{
|
{
|
||||||
struct uterm_vt *vt = data;
|
return !vt_call(data, action);
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
switch (action) {
|
|
||||||
case KMSCON_VT_ENTER:
|
|
||||||
ret = vt_call(vt, UTERM_VT_ACTIVATE);
|
|
||||||
break;
|
|
||||||
case KMSCON_VT_LEAVE:
|
|
||||||
ret = vt_call(vt, UTERM_VT_DEACTIVATE);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ret)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vt_idle_event(struct ev_eloop *eloop, void *unused, void *data)
|
static void vt_idle_event(struct ev_eloop *eloop, void *unused, void *data)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user