summary refs log tree commit diff
path: root/src/xfixes.zig
blob: 9eb8afcbe7f2b113a18ab5953e92ac5b6654ad33 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
const x11 = @import("x11.zig");
const Atom = x11.Atom;
const Display = x11.Display;
const False = x11.False;
const Window = x11.Window;
const getAtom = x11.getAtom;

const xfixes = @cImport({ @cInclude("X11/extensions/Xfixes.h"); });
const SET_SELECTION_OWNER = xfixes.XFixesSetSelectionOwnerNotifyMask;

extern fn XFixesSelectSelectionInput(display: *Display, window: Window,
                                     selection: Atom, event_mask: c_ulong) void;

pub fn getSelection(display: *Display, window: Window,
                    selection: [*c]const u8) void {
    const atom = getAtom(display, selection, False);
    XFixesSelectSelectionInput(display, window, atom, SET_SELECTION_OWNER);
}