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:
|
Changes since version 0.80.0:
|
||||||
.............................
|
.............................
|
||||||
|
|
||||||
|
|||||||
@@ -846,27 +846,28 @@ static void drawGrid(WMTableView *table, WMRect rect)
|
|||||||
static WMRange columnsInRect(WMTableView *table, WMRect rect)
|
static WMRange columnsInRect(WMTableView *table, WMRect rect)
|
||||||
{
|
{
|
||||||
WMTableColumn *column;
|
WMTableColumn *column;
|
||||||
int width;
|
int pos;
|
||||||
int i , j;
|
int i, found;
|
||||||
int totalColumns = WMGetArrayItemCount(table->columns);
|
int totalColumns = WMGetArrayItemCount(table->columns);
|
||||||
WMRange range;
|
WMRange range;
|
||||||
|
|
||||||
j = 0;
|
pos = 0;
|
||||||
width = 0;
|
found = 0;
|
||||||
for (i = 0; i < totalColumns; i++) {
|
for (i = 0; i < totalColumns; i++) {
|
||||||
column = WMGetFromArray(table->columns, i);
|
column = WMGetFromArray(table->columns, i);
|
||||||
if (j == 0) {
|
if (!found) {
|
||||||
if (width <= rect.pos.x && width + column->width > rect.pos.x) {
|
if (rect.pos.x >= pos && rect.pos.x < pos + column->width) {
|
||||||
range.position = i;
|
range.position = i;
|
||||||
j = 1;
|
range.count = 1;
|
||||||
|
found = 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
range.count++;
|
if (pos > rect.pos.x + rect.size.width) {
|
||||||
if (width > rect.pos.x + rect.size.width) {
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
range.count++;
|
||||||
}
|
}
|
||||||
width += column->width;
|
pos += column->width;
|
||||||
}
|
}
|
||||||
range.count = WMAX(1, WMIN(range.count, totalColumns - range.position));
|
range.count = WMAX(1, WMIN(range.count, totalColumns - range.position));
|
||||||
return range;
|
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 OpenSwitchMenu(WScreen *scr, int x, int y, int keyboard);
|
||||||
|
|
||||||
|
void InitializeSwitchMenu(void);
|
||||||
|
|
||||||
#endif /* !LITE */
|
#endif /* !LITE */
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -951,6 +951,10 @@ StartUp(Bool defaultScreenOnly)
|
|||||||
wScreenCount++;
|
wScreenCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef LITE
|
||||||
|
InitializeSwitchMenu();
|
||||||
|
#endif
|
||||||
|
|
||||||
/* initialize/restore state for the screens */
|
/* initialize/restore state for the screens */
|
||||||
for (j = 0; j < wScreenCount; j++) {
|
for (j = 0; j < wScreenCount; j++) {
|
||||||
int crashed;
|
int crashed;
|
||||||
|
|||||||
@@ -46,6 +46,9 @@ extern WPreferences wPreferences;
|
|||||||
extern Time LastTimestamp;
|
extern Time LastTimestamp;
|
||||||
|
|
||||||
|
|
||||||
|
static int initialized = 0;
|
||||||
|
|
||||||
|
|
||||||
static void observer(void *self, WMNotification *notif);
|
static void observer(void *self, WMNotification *notif);
|
||||||
static void wsobserver(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) {
|
if (!initialized) {
|
||||||
initialized = 1;
|
initialized = 1;
|
||||||
|
|
||||||
@@ -111,6 +106,19 @@ OpenSwitchMenu(WScreen *scr, int x, int y, int keyboard)
|
|||||||
WMAddNotificationObserver(wsobserver, NULL, WMNWorkspaceChanged, NULL);
|
WMAddNotificationObserver(wsobserver, NULL, WMNWorkspaceChanged, NULL);
|
||||||
WMAddNotificationObserver(wsobserver, NULL, WMNWorkspaceNameChanged, 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) {
|
||||||
if (switchmenu->flags.mapped) {
|
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);
|
WWindow *wwin = (WWindow*)WMGetNotificationObject(notif);
|
||||||
const char *name = WMGetNotificationName(notif);
|
const char *name = WMGetNotificationName(notif);
|
||||||
void *data = WMGetNotificationClientData(notif);
|
void *data = WMGetNotificationClientData(notif);
|
||||||
|
|
||||||
if (strcmp(name, WMNManaged) == 0 && wwin)
|
if (!wwin)
|
||||||
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_ADD);
|
return;
|
||||||
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 (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) {
|
if (strcmp((char*)data, "omnipresent") == 0) {
|
||||||
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_WORKSPACE);
|
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_WORKSPACE);
|
||||||
} else {
|
} 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);
|
WScreen *scr = (WScreen*)WMGetNotificationObject(notif);
|
||||||
const char *name = WMGetNotificationName(notif);
|
const char *name = WMGetNotificationName(notif);
|
||||||
|
|||||||
Reference in New Issue
Block a user