Skip to content

Instantly share code, notes, and snippets.

View psychon's full-sized avatar

Uli Schlachter psychon

  • In front of his laptop
View GitHub Profile
commit e689d373588fd07567b7a9a64c76a5278c159849
Author: Uli Schlachter <[email protected]>
Date: Fri Sep 11 09:49:15 2015 +0200
Make luaA_keystore() easier to follow
This now first unsets state and then sets the new state.
Signed-off-by: Uli Schlachter <[email protected]>
commit 78c98ba49daf590d9f97f33f35ceda7304561f01
Author: Uli Schlachter <[email protected]>
Date: Fri Sep 11 09:59:34 2015 +0200
Fix memory leaks with key->utf8
This commit does two things at once. This is bad. But surely blueyed will squash
things anyway. :-P
First, this makes luaA_keystore actually free key->utf8 before overwriting it.
@psychon
psychon / scroll.lua
Last active September 30, 2015 07:36
Follow API change: fit_widget wants self as first argument
---------------------------------------------------------------------------
-- @author Uli Schlachter (based on ideas from Saleur Geoffrey)
-- @copyright 2015 Uli Schlachter
-- @release @AWESOME_VERSION@
-- @classmod wibox.layout.scroll
---------------------------------------------------------------------------
local cache = require("gears.cache")
local timer = require("gears.timer")
local hierarchy = require("wibox.hierarchy")
From 00e765ecda8383e6b9ba17b240049f5617c9fac2 Mon Sep 17 00:00:00 2001
From: Uli Schlachter <[email protected]>
Date: Sun, 1 Nov 2015 17:53:53 +0100
Subject: [PATCH] Spawn: Improve handling of startup notification
The ID for startup notification is transmitted to the spawned process via the
DESKTOP_STARTUP_ID environment variable. Before this commit, we set this
variable in the main process. This meant that if we started something "without"
a startup id, then it might get the ID that was used by the last spawn and which
was still saved in our env. Fix this by setting the environment variable only
@psychon
psychon / scroll.lua
Created November 22, 2015 15:38
Scroll layout
---------------------------------------------------------------------------
-- @author Uli Schlachter (based on ideas from Saleur Geoffrey)
-- @copyright 2015 Uli Schlachter
-- @release @AWESOME_VERSION@
-- @classmod wibox.layout.scroll
---------------------------------------------------------------------------
local cache = require("gears.cache")
local color = require("gears.color")
local matrix = require("gears.matrix")
# In the following, I started the program, unplugged my USB mouse and re-plugged it.
# The empty lines are from me, I pressed enter after unplugging and after replugging the mouse.
$ QT_LOGGING_RULES="qt.qpa.input*=true" ./analogclock
qt.qpa.input.devices: XInput version 2.2 is available and Qt supports 2.2 or greater
qt.qpa.input.devices: input device Virtual core XTEST pointer
qt.qpa.input.devices: has 10 buttons
qt.qpa.input.devices: has valuator "Rel X" recognized? true
qt.qpa.input.devices: has valuator "Rel Y" recognized? true
qt.qpa.input.devices: it's a scrolling device
qt.qpa.input.devices: input device SynPS/2 Synaptics TouchPad
#include <alloca.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <xcb/xcb.h>
#define NEXT_ARG(argc, argv, val) do { \
if (argc <= 0) { \
fprintf(stderr, "Expected more arguments\n"); \
exit(1); \
diff --git a/ewmh.c b/ewmh.c
index 00aae38..aca6df4 100755
--- a/ewmh.c
+++ b/ewmh.c
@@ -683,15 +683,21 @@ ewmh_window_icon_from_reply(xcb_get_property_reply_t *r, uint32_t preferred_size
*/
while (true) {
/* pick the greater of the two dimensions to match against the preferred size */
+ printf("Looking at icon %ux%u at offset %lu (%lu)\n",
+ (unsigned int) data[0], (unsigned int) data[1],
@psychon
psychon / qt-input-fix.patch
Created December 13, 2015 17:42
Make Qt re-select XInput2 events on device hierarchy change only on windows where it actually asked for them before (and *not* on the root window)
diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
index 8097cce..f3e7b35 100644
--- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
@@ -761,8 +761,10 @@ void QXcbConnection::xi2HandleHierachyEvent(void *event)
return;
xi2SetupDevices();
// Reselect events for all event-listening windows.
- Q_FOREACH (xcb_window_t window, m_mapper.keys()) {
- xi2Select(window);
diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
index 8097cce..f079f02 100644
--- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
@@ -274,6 +274,7 @@ void QXcbConnection::finalizeXInput2()
void QXcbConnection::xi2Select(xcb_window_t window)
{
+ qWarning() << "xi2Select() called on " << window;
if (!m_xi2Enabled)