Skip to content

Commit

Permalink
ae.net.x11.package: Simplify the ClientMessage decoder
Browse files Browse the repository at this point in the history
I'm not sure about the reason for the previous code; I think I may
have been overthinking it. This did, however, require a fix in the
Deimos bindings.
  • Loading branch information
CyberShadow committed Dec 28, 2024
1 parent 6e8c843 commit ee6918b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
2 changes: 1 addition & 1 deletion dub.sdl
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ subPackage {
name "x11"
targetType "sourceLibrary"
dependency "ae" version="*" path="."
dependency "libx11" version="0.0.1"
dependency "libx11" version="0.0.2"
sourceFiles \
"sys/sendinput.d" \
"net/x11/*"
Expand Down
18 changes: 1 addition & 17 deletions net/x11/package.d
Original file line number Diff line number Diff line change
Expand Up @@ -1131,23 +1131,7 @@ private:
EventSpec!(SelectionRequest, simpleDecoder!(xEvent.SelectionRequest)),
EventSpec!(SelectionNotify , simpleDecoder!(xEvent.SelectionNotify )),
EventSpec!(ColormapNotify , simpleDecoder!(xEvent.Colormap )),
EventSpec!(ClientMessage ,
function(
Data data,
) {
auto reader = DataReader(data);
auto packet = *reader.read!(xEvent.ClientMessage)().enforce("Unexpected reply size");
struct Result
{
Atom type;
ubyte[20] bytes;
}
return Result(
packet.b.type,
cast(ubyte[20])packet.b.bytes,
);
}
),
EventSpec!(ClientMessage , simpleDecoder!(xEvent.ClientMessage )),
EventSpec!(MappingNotify , simpleDecoder!(xEvent.MappingNotify )),
// EventSpec!(GenericEvent , simpleDecoder!(xGenericEvent )),
);
Expand Down

0 comments on commit ee6918b

Please sign in to comment.