Skip to content

Instantly share code, notes, and snippets.

Avatar

Emmanuele Bassi ebassi

View GitHub Profile
@ebassi
ebassi / bool-size.c
Created Jul 26, 2020
Quick test for using C99's _Bool with GLib's gboolean
View bool-size.c
#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 / meson-html-report.py
Created Apr 13, 2019
Meson test log to HTML conversion script
View meson-html-report.py
#!/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 / meson-junit-report.py
Created Apr 13, 2019
Meson to JUnit report conversion script
View meson-junit-report.py
#!/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
View gtk_replies.md

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.
View gist:e2e698029af1cfc9a54ffaa8157be819
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()
View gist:23e397cce0a8c2b81419b8cdd62cec1b
/**
* 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 Jan 15, 2019
Find a UTF-8 glyph in your fonts
View fc-search-point.c
/* 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 \
@ebassi
ebassi / bashrc
Last active Mar 12, 2020
Fancy pants PS1
View bashrc
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
export EDITOR=vim
export PAGER=less
View gist:3a4ad519abedc2315f74e3643e78d0ba
{
"name": "tcl",
"no-autogen": true,
"cleanup-platform": ["*"],
"builddir": false,
"subdir": "unix",
"config-opts": [
"--disable-symbols"
],
"sources": [
@ebassi
ebassi / build-autofoo.sh
Last active Jan 27, 2017
Wrapper for non-srcdir builds with autotools
View build-autofoo.sh
#!/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:
You can’t perform that action at this time.