mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +01:00
Fixed some focus related problems when switching workspaces, including the
infamous problem with losing focus when switching to an empty workspace and back
This commit is contained in:
@@ -13,6 +13,8 @@ Changes since version 0.80.0:
|
|||||||
- Separated the font caches for normal fonts and fontsets in WINGs (they can
|
- Separated the font caches for normal fonts and fontsets in WINGs (they can
|
||||||
have the same names and collide in the cache giving unwanted results)
|
have the same names and collide in the cache giving unwanted results)
|
||||||
- Fixed Legal Panel not to display rectangles in place of new lines.
|
- Fixed Legal Panel not to display rectangles in place of new lines.
|
||||||
|
- Fixed problem with losing focus when changing to an empty workspace and back.
|
||||||
|
- Fixed another focus related problem when changing workspaces.
|
||||||
|
|
||||||
|
|
||||||
Changes since version 0.70.0:
|
Changes since version 0.70.0:
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ Changes since wmaker 0.80.0:
|
|||||||
- separated the font caches for normal fonts and fontsets in WINGs (they can
|
- separated the font caches for normal fonts and fontsets in WINGs (they can
|
||||||
have the same names and collide in the cache giving unwanted results)
|
have the same names and collide in the cache giving unwanted results)
|
||||||
- fixed labels not to display '\n' as a character if multiple '\n' are passed
|
- fixed labels not to display '\n' as a character if multiple '\n' are passed
|
||||||
|
but just skip to the next line.
|
||||||
|
|
||||||
|
|
||||||
Changes since wmaker 0.70.0:
|
Changes since wmaker 0.70.0:
|
||||||
|
|||||||
@@ -489,8 +489,9 @@ wWorkspaceForceChange(WScreen *scr, int workspace)
|
|||||||
wWorkspaceMenuUpdate(scr, scr->clip_ws_menu);
|
wWorkspaceMenuUpdate(scr, scr->clip_ws_menu);
|
||||||
|
|
||||||
if ((tmp = scr->focused_window)!= NULL) {
|
if ((tmp = scr->focused_window)!= NULL) {
|
||||||
if ((IS_OMNIPRESENT(tmp) && !WFLAGP(tmp, skip_window_list))
|
if ((IS_OMNIPRESENT(tmp) && (tmp->flags.mapped || tmp->flags.shaded)
|
||||||
|| tmp->flags.changing_workspace) {
|
&& !WFLAGP(tmp, no_focusable))
|
||||||
|
|| tmp->flags.changing_workspace) {
|
||||||
foc = tmp;
|
foc = tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -515,7 +516,7 @@ wWorkspaceForceChange(WScreen *scr, int workspace)
|
|||||||
tmp->icon->mapped = 0;
|
tmp->icon->mapped = 0;
|
||||||
}
|
}
|
||||||
/* update current workspace of omnipresent windows */
|
/* update current workspace of omnipresent windows */
|
||||||
if (IS_OMNIPRESENT(tmp)) {
|
if (IS_OMNIPRESENT(tmp)) {
|
||||||
WApplication *wapp = wApplicationOf(tmp->main_window);
|
WApplication *wapp = wApplicationOf(tmp->main_window);
|
||||||
|
|
||||||
tmp->frame->workspace = workspace;
|
tmp->frame->workspace = workspace;
|
||||||
@@ -523,7 +524,7 @@ wWorkspaceForceChange(WScreen *scr, int workspace)
|
|||||||
if (wapp) {
|
if (wapp) {
|
||||||
wapp->last_workspace = workspace;
|
wapp->last_workspace = workspace;
|
||||||
}
|
}
|
||||||
if (!foc2)
|
if (!foc2 && (tmp->flags.mapped || tmp->flags.shaded))
|
||||||
foc2 = tmp;
|
foc2 = tmp;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -538,7 +539,7 @@ wWorkspaceForceChange(WScreen *scr, int workspace)
|
|||||||
if (!(tmp->flags.mapped || tmp->flags.miniaturized)) {
|
if (!(tmp->flags.mapped || tmp->flags.miniaturized)) {
|
||||||
/* remap windows that are on this workspace */
|
/* remap windows that are on this workspace */
|
||||||
wWindowMap(tmp);
|
wWindowMap(tmp);
|
||||||
if (!foc && !WFLAGP(tmp, skip_window_list))
|
if (!foc && !WFLAGP(tmp, no_focusable))
|
||||||
foc = tmp;
|
foc = tmp;
|
||||||
}
|
}
|
||||||
/* Also map miniwindow if not omnipresent */
|
/* Also map miniwindow if not omnipresent */
|
||||||
@@ -617,7 +618,8 @@ wWorkspaceForceChange(WScreen *scr, int workspace)
|
|||||||
* 2) Make pager.
|
* 2) Make pager.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void wWorkspaceManageEdge(WScreen *scr)
|
void
|
||||||
|
wWorkspaceManageEdge(WScreen *scr)
|
||||||
{
|
{
|
||||||
int w;
|
int w;
|
||||||
int vmask;
|
int vmask;
|
||||||
@@ -658,7 +660,8 @@ void wWorkspaceManageEdge(WScreen *scr)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wWorkspaceRaiseEdge(WScreen *scr)
|
void
|
||||||
|
wWorkspaceRaiseEdge(WScreen *scr)
|
||||||
{
|
{
|
||||||
puts("raise edge");
|
puts("raise edge");
|
||||||
if (wPreferences.vedge_thickness && initVDesk) {
|
if (wPreferences.vedge_thickness && initVDesk) {
|
||||||
@@ -669,7 +672,8 @@ void wWorkspaceRaiseEdge(WScreen *scr)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wWorkspaceLowerEdge(WScreen *scr)
|
void
|
||||||
|
wWorkspaceLowerEdge(WScreen *scr)
|
||||||
{
|
{
|
||||||
puts("lower edge");
|
puts("lower edge");
|
||||||
if (wPreferences.vedge_thickness && initVDesk) {
|
if (wPreferences.vedge_thickness && initVDesk) {
|
||||||
@@ -680,13 +684,16 @@ void wWorkspaceLowerEdge(WScreen *scr)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wWorkspaceResizeViewPort(WScreen *scr, int workspace, int width, int height)
|
void
|
||||||
|
wWorkspaceResizeViewPort(WScreen *scr, int workspace, int width, int height)
|
||||||
{
|
{
|
||||||
scr->workspaces[workspace]->width = WMAX(width,scr->scr_width);
|
scr->workspaces[workspace]->width = WMAX(width,scr->scr_width);
|
||||||
scr->workspaces[workspace]->height = WMAX(height,scr->scr_height);
|
scr->workspaces[workspace]->height = WMAX(height,scr->scr_height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateWorkspaceGeometry(WScreen *scr, int workspace, int *view_x, int *view_y) {
|
void
|
||||||
|
updateWorkspaceGeometry(WScreen *scr, int workspace, int *view_x, int *view_y)
|
||||||
|
{
|
||||||
int most_left, most_right, most_top, most_bottom;
|
int most_left, most_right, most_top, most_bottom;
|
||||||
WWindow *wwin;
|
WWindow *wwin;
|
||||||
|
|
||||||
@@ -727,12 +734,16 @@ void updateWorkspaceGeometry(WScreen *scr, int workspace, int *view_x, int *view
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
typedef struct _delay_configure {
|
typedef struct _delay_configure {
|
||||||
WWindow *wwin;
|
WWindow *wwin;
|
||||||
int delay_count;
|
int delay_count;
|
||||||
} _delay_configure;
|
} _delay_configure;
|
||||||
|
|
||||||
void _sendConfigureNotify (_delay_configure *delay) {
|
|
||||||
|
void
|
||||||
|
sendConfigureNotify (_delay_configure *delay)
|
||||||
|
{
|
||||||
WWindow *wwin;
|
WWindow *wwin;
|
||||||
|
|
||||||
delay->delay_count--;
|
delay->delay_count--;
|
||||||
@@ -743,7 +754,9 @@ void _sendConfigureNotify (_delay_configure *delay) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Bool wWorkspaceSetViewPort(WScreen *scr, int workspace, int view_x, int view_y)
|
|
||||||
|
Bool
|
||||||
|
wWorkspaceSetViewPort(WScreen *scr, int workspace, int view_x, int view_y)
|
||||||
{
|
{
|
||||||
Bool adjust_flag = False;
|
Bool adjust_flag = False;
|
||||||
int diff_x, diff_y;
|
int diff_x, diff_y;
|
||||||
@@ -788,19 +801,23 @@ Bool wWorkspaceSetViewPort(WScreen *scr, int workspace, int view_x, int view_y)
|
|||||||
if (1) { /* if delay*/
|
if (1) { /* if delay*/
|
||||||
delay_configure.delay_count++;
|
delay_configure.delay_count++;
|
||||||
delay_configure.wwin = scr->focused_window;
|
delay_configure.wwin = scr->focused_window;
|
||||||
WMAddTimerHandler(200, (WMCallback *)_sendConfigureNotify, &delay_configure);
|
WMAddTimerHandler(200, (WMCallback *)sendConfigureNotify, &delay_configure);
|
||||||
}
|
}
|
||||||
|
|
||||||
return adjust_flag;
|
return adjust_flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wWorkspaceGetViewPosition(WScreen *scr, int workspace, int *view_x, int *view_y) {
|
|
||||||
|
void
|
||||||
|
wWorkspaceGetViewPosition(WScreen *scr, int workspace, int *view_x, int *view_y)
|
||||||
|
{
|
||||||
if (view_x) *view_x = scr->workspaces[workspace]->view_x;
|
if (view_x) *view_x = scr->workspaces[workspace]->view_x;
|
||||||
if (view_y) *view_y = scr->workspaces[workspace]->view_y;
|
if (view_y) *view_y = scr->workspaces[workspace]->view_y;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
switchWSCommand(WMenu *menu, WMenuEntry *entry)
|
switchWSCommand(WMenu *menu, WMenuEntry *entry)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user