Skip to content

Instantly share code, notes, and snippets.

View ebassi's full-sized avatar

Emmanuele Bassi ebassi

View GitHub Profile
@ebassi
ebassi / meson-html-report.py
Created April 13, 2019 16:05
Meson test log to HTML conversion script
#!/usr/bin/env python3
# meson-junit-report.py: Turns a Meson test log into an HTML report
#
# Copyright 2019 GNOME Foundation
#
# SPDX-License-Identifier: LGPL-2.1-or-later
import argparse
import datetime
@ebassi
ebassi / bool-size.c
Created July 26, 2020 17:45
Quick test for using C99's _Bool with GLib's gboolean
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <glib-object.h>
typedef unsigned char my_bool_t;
G_DECLARE_FINAL_TYPE (TestObject, test_object, TEST, OBJECT, GObject)
struct _TestObject
@ebassi
ebassi / bashrc
Last active March 12, 2020 10:49
Fancy pants PS1
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
export EDITOR=vim
export PAGER=less
@ebassi
ebassi / meson-junit-report.py
Created April 13, 2019 16:04
Meson to JUnit report conversion script
#!/usr/bin/env python3
#
# meson-junit-report.py: Turns a Meson test log into a JUnit report
#
# Copyright 2019 GNOME Foundation
#
# SPDX-License-Identifier: LGPL-2.1-or-later
import argparse
import datetime

In Menu Bar 1 (constructed using Gio::Menu): How can one add tooltips? How can one give a CSS class or id to a widget?

  • Menus constructed with GMenu do not have tooltips; we find that tooltips are generally problematic in menu context due to how tooltips and menus are implemented using similar windowing system constructs that end up competing for event handling and stacking. Additionally, menus constructed with GMenu could be sent over some IPC mechanism, to other entities, like the compositor, which may or may not have the concept of "tooltip".
  • Menus constructed with GMenu do not have CSS style information. Like with tooltips, menus could be displayed by something that is not the application, which means style information is not transferrable.
After a grab (either a clutter grab or an X grab involving windows overlapping
the stage), clutter can be confused about what actor contains the pointer.
For https://bugzilla.gnome.org/show_bug.cgi?id=630842, when we suspect that
clutter might be out of sync, we recover by posting a fake CLUTTER_MOTION
event, which as a side effect will result in clutter eventually calling
_clutter_input_device_update(). But it would be nicer to have a guaranteed way
of doing this.
At first I thought we could just make _clutter_device_manager_update_devices()
/**
* login1_session_complete_take_device:
* @object: A #Login1Session.
* @invocation: (transfer full): A #GDBusMethodInvocation.
* @fd_list: (nullable): A #GUnixFDList or %NULL.
* @fd: Parameter to return.
* @paused: Parameter to return.
*
* Helper function used in service implementations to finish handling invocations of the <link linkend="gd
bus-method-org-freedesktop-login1-Session.TakeDevice">TakeDevice()</link> D-Bus method. If you instead wan
@ebassi
ebassi / fc-search-point.c
Created January 15, 2019 15:32
Find a UTF-8 glyph in your fonts
/* fc-search-point.c: Search for a UTF-8 code point in the installed fonts
*
* Requires: fontconfig
*
* Build with:
*
* ```sh
* $ cc \
* `pkg-config --cflags fontconfig` \
* -o fc-search-point fc-search-point.c \
{
"name": "tcl",
"no-autogen": true,
"cleanup-platform": ["*"],
"builddir": false,
"subdir": "unix",
"config-opts": [
"--disable-symbols"
],
"sources": [
@ebassi
ebassi / build-autofoo.sh
Last active January 27, 2017 15:58
Wrapper for non-srcdir builds with autotools
#!/bin/bash
# Copyright 2017 Emmanuele Bassi. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions: