mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +01:00
- Fixed empty window list menu, if the window list menu was launched through
the root menu ("Marc-Christian Petersen" <m.c.p@wolk-project.de>)
- A small fix for wmtableview when computing visible columns.
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
Changes since version 0.80.1:
|
||||
.............................
|
||||
|
||||
- Some updates to WINGs WMConnection. See WINGs/ChangeLog for details.
|
||||
- Fixed empty window list menu, if the window list menu was launched through
|
||||
the root menu ("Marc-Christian Petersen" <m.c.p@wolk-project.de>)
|
||||
|
||||
|
||||
Changes since version 0.80.0:
|
||||
.............................
|
||||
|
||||
|
||||
@@ -846,27 +846,28 @@ static void drawGrid(WMTableView *table, WMRect rect)
|
||||
static WMRange columnsInRect(WMTableView *table, WMRect rect)
|
||||
{
|
||||
WMTableColumn *column;
|
||||
int width;
|
||||
int i , j;
|
||||
int pos;
|
||||
int i, found;
|
||||
int totalColumns = WMGetArrayItemCount(table->columns);
|
||||
WMRange range;
|
||||
|
||||
j = 0;
|
||||
width = 0;
|
||||
pos = 0;
|
||||
found = 0;
|
||||
for (i = 0; i < totalColumns; i++) {
|
||||
column = WMGetFromArray(table->columns, i);
|
||||
if (j == 0) {
|
||||
if (width <= rect.pos.x && width + column->width > rect.pos.x) {
|
||||
if (!found) {
|
||||
if (rect.pos.x >= pos && rect.pos.x < pos + column->width) {
|
||||
range.position = i;
|
||||
j = 1;
|
||||
range.count = 1;
|
||||
found = 1;
|
||||
}
|
||||
} else {
|
||||
range.count++;
|
||||
if (width > rect.pos.x + rect.size.width) {
|
||||
if (pos > rect.pos.x + rect.size.width) {
|
||||
break;
|
||||
}
|
||||
range.count++;
|
||||
}
|
||||
width += column->width;
|
||||
pos += column->width;
|
||||
}
|
||||
range.count = WMAX(1, WMIN(range.count, totalColumns - range.position));
|
||||
return range;
|
||||
|
||||
@@ -57,6 +57,8 @@ void OpenRootMenu(WScreen *scr, int x, int y, int keyboard);
|
||||
|
||||
void OpenSwitchMenu(WScreen *scr, int x, int y, int keyboard);
|
||||
|
||||
void InitializeSwitchMenu(void);
|
||||
|
||||
#endif /* !LITE */
|
||||
|
||||
|
||||
|
||||
@@ -951,6 +951,10 @@ StartUp(Bool defaultScreenOnly)
|
||||
wScreenCount++;
|
||||
}
|
||||
|
||||
#ifndef LITE
|
||||
InitializeSwitchMenu();
|
||||
#endif
|
||||
|
||||
/* initialize/restore state for the screens */
|
||||
for (j = 0; j < wScreenCount; j++) {
|
||||
int crashed;
|
||||
|
||||
@@ -46,6 +46,9 @@ extern WPreferences wPreferences;
|
||||
extern Time LastTimestamp;
|
||||
|
||||
|
||||
static int initialized = 0;
|
||||
|
||||
|
||||
static void observer(void *self, WMNotification *notif);
|
||||
static void wsobserver(void *self, WMNotification *notif);
|
||||
|
||||
@@ -85,18 +88,10 @@ focusWindow(WMenu *menu, WMenuEntry *entry)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* Open switch menu
|
||||
*
|
||||
*/
|
||||
void
|
||||
OpenSwitchMenu(WScreen *scr, int x, int y, int keyboard)
|
||||
{
|
||||
WMenu *switchmenu = scr->switch_menu;
|
||||
WWindow *wwin;
|
||||
static int initialized = 0;
|
||||
|
||||
void
|
||||
InitializeSwitchMenu()
|
||||
{
|
||||
if (!initialized) {
|
||||
initialized = 1;
|
||||
|
||||
@@ -111,6 +106,19 @@ OpenSwitchMenu(WScreen *scr, int x, int y, int keyboard)
|
||||
WMAddNotificationObserver(wsobserver, NULL, WMNWorkspaceChanged, NULL);
|
||||
WMAddNotificationObserver(wsobserver, NULL, WMNWorkspaceNameChanged, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* Open switch menu
|
||||
*
|
||||
*/
|
||||
void
|
||||
OpenSwitchMenu(WScreen *scr, int x, int y, int keyboard)
|
||||
{
|
||||
WMenu *switchmenu = scr->switch_menu;
|
||||
WWindow *wwin;
|
||||
|
||||
if (switchmenu) {
|
||||
if (switchmenu->flags.mapped) {
|
||||
@@ -400,24 +408,27 @@ UpdateSwitchMenuWorkspace(WScreen *scr, int workspace)
|
||||
}
|
||||
|
||||
|
||||
static void observer(void *self, WMNotification *notif)
|
||||
static void
|
||||
observer(void *self, WMNotification *notif)
|
||||
{
|
||||
WWindow *wwin = (WWindow*)WMGetNotificationObject(notif);
|
||||
const char *name = WMGetNotificationName(notif);
|
||||
void *data = WMGetNotificationClientData(notif);
|
||||
|
||||
if (strcmp(name, WMNManaged) == 0 && wwin)
|
||||
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_ADD);
|
||||
else if (strcmp(name, WMNUnmanaged) == 0 && wwin)
|
||||
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_REMOVE);
|
||||
else if (strcmp(name, WMNChangedWorkspace) == 0 && wwin)
|
||||
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_WORKSPACE);
|
||||
else if (strcmp(name, WMNChangedFocus) == 0 && wwin)
|
||||
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE);
|
||||
else if (strcmp(name, WMNChangedName) == 0 && wwin)
|
||||
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE);
|
||||
else if (strcmp(name, WMNChangedState) == 0 && wwin) {
|
||||
if (!wwin)
|
||||
return;
|
||||
|
||||
if (strcmp(name, WMNManaged) == 0)
|
||||
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_ADD);
|
||||
else if (strcmp(name, WMNUnmanaged) == 0)
|
||||
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_REMOVE);
|
||||
else if (strcmp(name, WMNChangedWorkspace) == 0)
|
||||
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_WORKSPACE);
|
||||
else if (strcmp(name, WMNChangedFocus) == 0)
|
||||
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE);
|
||||
else if (strcmp(name, WMNChangedName) == 0)
|
||||
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE);
|
||||
else if (strcmp(name, WMNChangedState) == 0) {
|
||||
if (strcmp((char*)data, "omnipresent") == 0) {
|
||||
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_WORKSPACE);
|
||||
} else {
|
||||
@@ -427,7 +438,8 @@ static void observer(void *self, WMNotification *notif)
|
||||
}
|
||||
|
||||
|
||||
static void wsobserver(void *self, WMNotification *notif)
|
||||
static void
|
||||
wsobserver(void *self, WMNotification *notif)
|
||||
{
|
||||
WScreen *scr = (WScreen*)WMGetNotificationObject(notif);
|
||||
const char *name = WMGetNotificationName(notif);
|
||||
|
||||
Reference in New Issue
Block a user