Skip to content

Commit

Permalink
Fix Bug #3160010: systray problem
Browse files Browse the repository at this point in the history
Year and version number bump.  Tested clang, which compiles
uwm without promblems.
  • Loading branch information
Johns-Q committed Apr 27, 2011
1 parent cd0666c commit 064b418
Show file tree
Hide file tree
Showing 7 changed files with 120 additions and 32 deletions.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# @file Makefile @brief make file
#
# Copyright (c) 2009, 2010 by Lutz Sammer. All Rights Reserved.
# Copyright (c) 2009 - 2011 by Lutz Sammer. All Rights Reserved.
#
# Contributor(s):
#
Expand Down Expand Up @@ -139,15 +139,16 @@ DEFS = $(CONFIG) #### $(addprefix -D, $(CONFIG))

#----------------------------------------------------------------------------

VERSION = "0.25"
VERSION = "0.26"
GIT_REV = $(shell git describe --always 2>/dev/null)

CC= gcc
#CC= clang

#MARCH= -march=armv6j -mtune=arm1136jf-s -mfpu=vfp -mfloat-abi=softfp
#MARCH= -march=native
#MARCH= -muclibc
OPTIM= -U_FORTIFY_SOURCE -D__OPTIMIZE__ -O0 -Os -fomit-frame-pointer
OPTIM= -U_FORTIFY_SOURCE -D__OPTIMIZE__ -Os -fomit-frame-pointer
CFLAGS= $(MARCH) $(OPTIM) -W -Wall -Wextra -g -pipe \
-I. $(DEFS) -DVERSION='$(VERSION)' \
$(if $(GIT_REV), -DGIT_REV='"$(GIT_REV)"') \
Expand Down
3 changes: 2 additions & 1 deletion client.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
///
/// @file client.c @brief client functions
///
/// Copyright (c) 2009, 2010 by Lutz Sammer. All Rights Reserved.
/// Copyright (c) 2009 - 2011 by Lutz Sammer. All Rights Reserved.
///
/// Contributor(s):
///
Expand Down Expand Up @@ -1508,6 +1508,7 @@ void ClientSetWithdrawn(Client * client)
WM_STATE_SHOW_DESKTOP);

// FIXME: need only to update WM_STATE_MAPPED!
// FIXME: HintSetWMState
HintSetAllStates(client);

TaskUpdate();
Expand Down
4 changes: 2 additions & 2 deletions hints.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
///
/// @file hints.c @brief window manager hints functions.
///
/// Copyright (c) 2009, 2010 by Lutz Sammer. All Rights Reserved.
/// Copyright (c) 2009 - 2011 by Lutz Sammer. All Rights Reserved.
///
/// Contributor(s):
///
Expand Down Expand Up @@ -1141,7 +1141,7 @@ static void HintSetWMState(const Client * client)
} else {
Debug(3, "set withdrawn %x\n", client->Window);
values[0] = XCB_WM_STATE_WITHDRAWN;
values[0] = XCB_WM_STATE_NORMAL;
//values[0] = XCB_WM_STATE_NORMAL;
}
values[1] = XCB_NONE;

Expand Down
4 changes: 3 additions & 1 deletion menu.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
///
/// @file menu.c @brief menu functions
///
/// Copyright (c) 2009, 2010 by Lutz Sammer. All Rights Reserved.
/// Copyright (c) 2009 - 2011 by Lutz Sammer. All Rights Reserved.
///
/// Contributor(s):
///
Expand Down Expand Up @@ -95,6 +95,8 @@ extern const char *xcb_event_get_label(uint8_t);
/// These functions and all dependencies are only available if compiled
/// widh #USE_DIALOG.
///
/// @todo add support for keyboard
///
/// @{

#ifdef USE_DIALOG // {
Expand Down
115 changes: 93 additions & 22 deletions property.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
///
/// @file property.c @brief x11 property handler functions
///
/// Copyright (c) 2009, 2010 by Lutz Sammer. All Rights Reserved.
/// Copyright (c) 2009 - 2011 by Lutz Sammer. All Rights Reserved.
///
/// Contributor(s):
///
Expand Down Expand Up @@ -51,6 +51,7 @@
#include "hints.h"
#include "icon.h"
#include "menu.h"
#include "desktop.h"

#include "panel.h"
#include "plugin/task.h"
Expand All @@ -76,7 +77,7 @@ static xcb_property_handlers_t PropertyHandlers;
** @param atom atom of changed property
** @param property get property request of changed property
*/
int HandlePropertyDefault( __attribute__ ((unused))
static int HandlePropertyDefault( __attribute__ ((unused))
void *data, __attribute__ ((unused)) xcb_connection_t * conn,
__attribute__ ((unused)) uint8_t state,
__attribute__ ((unused)) xcb_window_t window, xcb_atom_t atom,
Expand Down Expand Up @@ -104,6 +105,75 @@ int HandlePropertyDefault( __attribute__ ((unused))
}
#endif

/**
** Handle WM hints property change.
**
** @param data user data (unused).
** @param conn xcb connection
** @param state property state
** @param window window which property was changed
** @param atom atom of changed property
** @param property get property request of changed property
**
** @returns always true.
*/
static int HandlePropertyWMHints( __attribute__ ((unused))
void *data, __attribute__ ((unused)) xcb_connection_t * conn,
__attribute__ ((unused)) uint8_t state, xcb_window_t window,
xcb_atom_t atom, xcb_get_property_reply_t * property)
{
Client *client;

Debug(3, "%s: atom %x\n", __FUNCTION__, atom);

if ((client = ClientFindByChild(window))) {
xcb_wm_hints_t wm_hints;

if (xcb_get_wm_hints_from_reply(&wm_hints, property)
&& wm_hints.flags & XCB_WM_HINT_STATE) {
switch (wm_hints.initial_state) {
case XCB_WM_STATE_WITHDRAWN:
case XCB_WM_STATE_NORMAL:
Debug(3, "%s: client %x mapped\n", __FUNCTION__, window);
//FIXME: see map request
#if 0
xcb_map_window(Connection, client->Window);
if (!(client->State & WM_STATE_MAPPED)) {
client->State |= WM_STATE_MAPPED;
client->State &= ~(WM_STATE_MINIMIZED
| WM_STATE_SHOW_DESKTOP | WM_STATE_HIDDEN
| WM_STATE_SHADED);
if (!(client->State & WM_STATE_STICKY)) {
client->Desktop = DesktopCurrent;
}
xcb_map_window(Connection, client->Window);
xcb_map_window(Connection, client->Parent);
ClientRaise(client);
ClientFocus(client);
// Done by focus: TaskUpdate();
// Done by focus: PagerUpdate();
}
ClientRestack();
#endif
break;
case XCB_WM_STATE_ICONIC:
Debug(3, "%s: client %x minimized\n", __FUNCTION__, window);
//FIXME:
// client->State |= WM_STATE_MINIMIZED;
break;
}
} else { // defaults to mapped
Debug(3, "%s: client %x no state\n", __FUNCTION__, window);
//FIXME:
}

BorderDraw(client, NULL);
TaskUpdate();
}

return 1;
}

/**
** Handle normal hints property change.
**
Expand All @@ -116,7 +186,7 @@ int HandlePropertyDefault( __attribute__ ((unused))
**
** @returns always true.
*/
int HandlePropertyNormalHints( __attribute__ ((unused))
static int HandlePropertyWMNormalHints( __attribute__ ((unused))
void *data, __attribute__ ((unused)) xcb_connection_t * conn,
__attribute__ ((unused)) uint8_t state,
__attribute__ ((unused)) xcb_window_t window, xcb_atom_t atom,
Expand All @@ -141,7 +211,7 @@ int HandlePropertyNormalHints( __attribute__ ((unused))
**
** @todo property argument isn't used.
*/
int HandlePropertyWMName( __attribute__ ((unused))
static int HandlePropertyWMName( __attribute__ ((unused))
void *data, __attribute__ ((unused)) xcb_connection_t * conn,
__attribute__ ((unused)) uint8_t state, xcb_window_t window,
xcb_atom_t atom,
Expand Down Expand Up @@ -172,32 +242,33 @@ void PropertyInit(void)
// ICCCM atoms
xcb_property_set_handler(&PropertyHandlers, WM_NAME, UINT32_MAX,
HandlePropertyWMName, NULL);
xcb_property_set_handler(&PropertyHandlers, WM_HINTS, UINT32_MAX,
HandlePropertyWMHints, NULL);
xcb_property_set_handler(&PropertyHandlers, WM_NORMAL_HINTS, UINT32_MAX,
HandlePropertyWMNormalHints, NULL);
// EWMH atoms
xcb_property_set_handler(&PropertyHandlers, Atoms.NET_WM_NAME.Atom,
UINT32_MAX, HandlePropertyWMName, NULL);
#if 0
xcb_property_set_handler(&PropertyHandlers, WM_TRANSIENT_FOR, UINT32_MAX,
property_handle_wm_transient_for, NULL);
xcb_property_set_handler(&PropertyHandlers, WM_CLIENT_LEADER, UINT32_MAX,
property_handle_wm_client_leader, NULL);
xcb_property_set_handler(&PropertyHandlers, WM_NORMAL_HINTS, UINT32_MAX,
property_handle_wm_normal_hints, NULL);
xcb_property_set_handler(&PropertyHandlers, WM_HINTS, UINT32_MAX,
property_handle_wm_hints, NULL);
xcb_property_set_handler(&PropertyHandlers, WM_ICON_NAME, UINT32_MAX,
property_handle_wm_icon_name, NULL);
xcb_property_set_handler(&PropertyHandlers, Atoms.WM_TRANSIENT_FOR.Atom,
UINT32_MAX, HandleProperty_wm_transient_for, NULL);
xcb_property_set_handler(&PropertyHandlers, Atoms.WM_CLIENT_LEADER.Atom,
UINT32_MAX, HandleProperty_wm_client_leader, NULL);
xcb_property_set_handler(&PropertyHandlers, Atoms.WM_ICON_NAME.Atom,
UINT32_MAX, HandleProperty_wm_icon_name, NULL);
// ATOM_WM_COLORMAP_WINDOWS

xcb_property_set_handler(&PropertyHandlers, _NET_WM_ICON_NAME, UINT32_MAX,
property_handle_wm_icon_name, NULL);
xcb_property_set_handler(&PropertyHandlers, _NET_WM_STRUT_PARTIAL,
UINT32_MAX, property_handle_net_wm_strut_partial, NULL);
xcb_property_set_handler(&PropertyHandlers, _NET_WM_ICON, UINT32_MAX,
property_handle_net_wm_icon, NULL);
xcb_property_set_handler(&PropertyHandlers, Atoms._NET_WM_ICON_NAME.Atom,
UINT32_MAX, HandleProperty_wm_icon_name, NULL);
xcb_property_set_handler(&PropertyHandlers,
Atoms._NET_WM_STRUT_PARTIAL.Atom, UINT32_MAX,
HandleProperty_net_wm_strut_partial, NULL);
xcb_property_set_handler(&PropertyHandlers, Atoms._NET_WM_ICON.Atom,
UINT32_MAX, HandleProperty_net_wm_icon, NULL);

// background change
xcb_property_set_handler(&PropertyHandlers, _XROOTPMAP_ID, 1,
property_handle_xrootpmap_id, NULL);
xcb_property_set_handler(&PropertyHandlers, Atoms._XROOTPMAP_ID.Atom, 1,
HandleProperty_xrootpmap_id, NULL);
#endif
#ifdef DEBUG
xcb_property_set_default_handler(&PropertyHandlers, UINT32_MAX,
Expand Down
18 changes: 15 additions & 3 deletions uwm.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
///
/// @file uwm.c @brief µwm µ window manager main file
///
/// Copyright (c) 2009, 2010 by Lutz Sammer. All Rights Reserved.
/// Copyright (c) 2009 - 2011 by Lutz Sammer. All Rights Reserved.
///
/// Contributor(s):
/// based on jwm from Joe Wingbermuehle
Expand Down Expand Up @@ -662,7 +662,7 @@ static void PrintVersion(void)
#ifdef GIT_REV
"(GIT-" GIT_REV ")"
#endif
", (c) 2009, 2010 by Lutz Sammer\n"
", (c) 2009 - 2011 by Lutz Sammer\n"
"\tLicense AGPLv3: GNU Affero General Public License version 3\n");
}

Expand All @@ -677,6 +677,9 @@ static void PrintUsage(void)
"\t-e\texit µWM (send _UWM_EXIT to the root window)\n"
"\t-r\trestart µWM (send _UWM_RESTART to the root window)\n"
"\t-p\tparse the configuration file and exit\n"
#ifdef DEBUG
"\t-D\tincrease debug level (more and verbose output)\n"
#endif
"\t-? -h\tdisplay this message\n" "\t-v\tdisplay version information\n"
"Only idiots print usage on stderr!\n");
}
Expand All @@ -698,7 +701,7 @@ int main(int argc, char *const argv[])
// Parse command line arguments
//
for (;;) {
switch (getopt(argc, argv, "hv?-c:d:epr")) {
switch (getopt(argc, argv, "hv?-c:d:eprD")) {
case 'c': // config file
config_filename = optarg;
continue;
Expand All @@ -717,6 +720,15 @@ int main(int argc, char *const argv[])
ConnectionClose();
return 0;

case 'D': // increase debug level
#ifdef DEBUG
++DebugLevel;
continue;
#else
fprintf(stderr, "\nCompiled without debug support\n");
return -1;
#endif

case EOF:
break;
case 'v': // print version
Expand Down
1 change: 1 addition & 0 deletions www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ <h3>Features</h3>
<LI>multiple screen (xinerama)
<LI>64-bit and 32-bit clean; little-endian and big-endian working
<LI>compatible with uclibc and libc6
<LI>compatible with GCC 4.5.2 and Clang 2.8
</UL>

<h2 id="news">News</h2>
Expand Down

0 comments on commit 064b418

Please sign in to comment.